[Plugin] System date and time

Post your completed addons to share with the community

Post » Fri Dec 21, 2012 10:27 am

@Joannesalfa

I guess, might be saving "Year/Month/Date" into webstorage?
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Fri Dec 21, 2012 11:44 am

[QUOTE=rexrainbow] @Joannesalfa

I guess, might be saving "Year/Month/Date" into webstorage?[/QUOTE]

No, count of days since the first launch of application
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Fri Dec 21, 2012 3:17 pm

@Joannesalfa

Uh, I mean, compare previous saved "Year/Month/Date" with current "Year/Month/Date" to get days.
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Fri Dec 21, 2012 7:15 pm

[QUOTE=rexrainbow] @Joannesalfa

Uh, I mean, compare previous saved "Year/Month/Date" with current "Year/Month/Date" to get days.[/QUOTE]

Yes, i was wondering how to make it, let's compare saved "Year/Month/Date" with current "Year/Month/Date" but i had no idea how to get the counted days. Does it require loop?
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Sat Dec 22, 2012 12:59 am

@ Joannesalfa

Convert seconds to days hours minutes and seconds.
[code]numdays = Math.floor(seconds / 86400)
numhours = Math.floor((seconds % 86400) / 3600)
numminutes = Math.floor(((seconds % 86400) % 3600) / 60)
numseconds = ((seconds % 86400) % 3600) % 60[/code]
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Sat Dec 22, 2012 11:56 am

Hi @rexrainbow

I am currently looking for a way to convert the date and time into a unix timestamp, and vice versa.
Meaning that the user of my app could fill in a date and time, so my app knows which timestamp it needs to set.
This way i could save 1 "future" set timestamp, and a present set timestamp.
THen compare them every thick, and move set actions to the difference between the 2 stamps.
Can u build in a expression for this which converts the date & time, or am i missing something that is already build in?

Kind regards.
Savvy001Savvy0012012-12-22 12:07:41
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Sat Dec 22, 2012 8:44 pm

[QUOTE=rexrainbow] @ Joannesalfa

Convert seconds to days hours minutes and seconds.
[code]numdays = Math.floor(seconds / 86400)
numhours = Math.floor((seconds % 86400) / 3600)
numminutes = Math.floor(((seconds % 86400) % 3600) / 60)
numseconds = ((seconds % 86400) % 3600) % 60[/code]
[/QUOTE]

It looks like nice workaround, i think it's possible to get seconds since on start layout and keep saving seconds variable via webstorage... but what happens if on start layout and got 24 seconds = 0 day, then quit application and wait for 3 days, start app again and it could result was 24 seconds = 0 day, exceptation result should be like 3463456 seconds = 3 days.

There an another website could help us, according to

the script doesnt update every second. Updating the day counter every second is not needed since the number of days doesnt change every second. The below script updates the counter only when the day count mentioned in the counter has to change.



http://praveenlobo.com/techblog/javascript-counter-count-days/
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Mon Dec 24, 2012 6:03 am

@Savvy001

I will try this when I have time, thanks for suggestion.
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Mon Dec 24, 2012 10:24 pm

@rexrainbow

U just made my day!
Please let me know when the time comes
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Tue Dec 25, 2012 12:13 am

Isn't there a way to get counted days since first launch?
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 4 guests