[Plugin] System date and time

Post your completed addons to share with the community

Post » Wed Apr 01, 2015 3:24 pm

@rexrainbow

uh i dont get that unix timestamp.... how to pinpoint exact time?
eg.
when user opens the app i take a time stamp and i would like to set session time to expire at midnight every day (23:59)
so that all downloaded data is valid for that day till 23:59 and when session is expired to reload all data (or next time the app is open)
problem i have is when app is not opened for days...
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Wed Apr 01, 2015 3:42 pm

and one more small problem...
if user manipulates time on his sistem that affects my calculations... :(
is there a way to retrieve correct time/date from some world clock URL?
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Wed Apr 01, 2015 3:48 pm

@irina

This plugin only read timestamp at local machine.
"World clock" is another issue, it might need a service/server.
B
107
S
25
G
224
Posts: 4,322
Reputation: 127,821

Post » Tue Apr 07, 2015 4:26 pm

Does it work on mobile? CocoonJS for example?
B
36
S
8
G
8
Posts: 539
Reputation: 8,425

Post » Tue Apr 07, 2015 4:50 pm

@xanxion

It works on cocoonJS and browser.
B
107
S
25
G
224
Posts: 4,322
Reputation: 127,821

Post » Tue Apr 07, 2015 10:18 pm

Lovely! thanks Rex!
B
36
S
8
G
8
Posts: 539
Reputation: 8,425

Post » Wed Apr 15, 2015 5:20 am

Update

Add time away L plugin which get elapsed interval of turned off game from local storage.
B
107
S
25
G
224
Posts: 4,322
Reputation: 127,821

Post » Wed Apr 15, 2015 12:07 pm

Does this work with cordova (crosswalk and phonegap) too?
B
17
S
5
Posts: 46
Reputation: 1,107

Post » Wed Apr 15, 2015 10:48 pm

@rexrainbow what i should do to create condition if time elapsed is more than 3600 (one hour)
on start of layout do something ?
B
103
S
25
G
39
Posts: 1,875
Reputation: 31,383

Post » Wed Apr 15, 2015 11:03 pm

Hey @delgado old friend, still having troubles with "System date" plugin? :)

First you need to save current time somewhere in your events. Webstorage was usually very good at it.

In your event's (when you want to save time) make event - > "Webstorage: Set local key "OldTime" to Data.UnixTimestamp
Then on start of the layout you need to compare that to check if one hour have passed.
on start of layout -> 3600 < Date.UnixTimestamp - int(WebStorage.LocalValue("OldTime")) - > do your events

It basically says "if 3600 is less then (current time - saved time) then one hour have passed".
ImageImageImageImage
B
155
S
61
G
41
Posts: 2,577
Reputation: 34,314

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: aldi45mts, Baidu [Spider], undeadbobop and 1 guest