[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
97
S
22
G
179
Posts: 4,124
Reputation: 104,555

Post » Tue Apr 07, 2015 4:26 pm

Does it work on mobile? CocoonJS for example?
B
34
S
8
G
7
Posts: 498
Reputation: 7,753

Post » Tue Apr 07, 2015 4:50 pm

@xanxion

It works on cocoonJS and browser.
B
97
S
22
G
179
Posts: 4,124
Reputation: 104,555

Post » Tue Apr 07, 2015 10:18 pm

Lovely! thanks Rex!
B
34
S
8
G
7
Posts: 498
Reputation: 7,753

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
97
S
22
G
179
Posts: 4,124
Reputation: 104,555

Post » Wed Apr 15, 2015 12:07 pm

Does this work with cordova (crosswalk and phonegap) too?
B
15
S
4
Posts: 40
Reputation: 945

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
94
S
19
G
34
Posts: 1,840
Reputation: 27,988

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
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest