[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
101
S
24
G
199
Posts: 4,216
Reputation: 114,674

Post » Tue Apr 07, 2015 4:26 pm

Does it work on mobile? CocoonJS for example?
B
36
S
8
G
7
Posts: 538
Reputation: 7,923

Post » Tue Apr 07, 2015 4:50 pm

@xanxion

It works on cocoonJS and browser.
B
101
S
24
G
199
Posts: 4,216
Reputation: 114,674

Post » Tue Apr 07, 2015 10:18 pm

Lovely! thanks Rex!
B
36
S
8
G
7
Posts: 538
Reputation: 7,923

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
101
S
24
G
199
Posts: 4,216
Reputation: 114,674

Post » Wed Apr 15, 2015 12:07 pm

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

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
99
S
22
G
37
Posts: 1,867
Reputation: 29,973

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
147
S
58
G
38
Posts: 2,559
Reputation: 32,570

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest