Stencyl 3.4.0 is now out. Get it now!

Date Extension

FMStudioGameDev

  • *
  • Posts: 129
Timestamp shows how many seconds have passed since  January 1, 1970 at 00:00:00 UTC.

And yes this extension does exactly what you said, you just have to take current timestamp minus last saved timestamp and you know exactly how many time have passed.  Than you can just convert returned milliseconds into minutes, hours, days...

What exactly does the timestamp do? Does it convert the actual date into milliseconds? and if yes, where does it start? It currently shows me 1.3 billion seconds, and one year has 31million seconds, so it shows me the past 47 years in seconds?

Anyhow, I want to use it to calculate offline gain, so I assume I can just get a current time stamp - last time stamp and have the seconds the user didn't play the game? Does it acknowledge the varying number of days within a month?

Many questions, but I just wanted a quick check before I base my game on it.
Thank you!

Irock

  • *
  • Posts: 2838
What exactly does the timestamp do? Does it convert the actual date into milliseconds? and if yes, where does it start? It currently shows me 1.3 billion seconds, and one year has 31million seconds, so it shows me the past 47 years in seconds?
https://en.wikipedia.org/wiki/Unix_time

RemedySaveMe

  • Posts: 8
Thanks mate. Very Cool.

addable13

  • *
  • Posts: 3
I'm having problems installing

orbinho11

  • *
  • Posts: 4
How do we install this extension? I've tried to copy it to many places but it didn't work :(


NOTA

  • Posts: 129
Where did the extension go????

NOTA

  • Posts: 129
If I do DateTools.format(Date.now(),"%H:%M")
get hour,if hr=1,play sound)   <- it works great.
but when I add (if hr=1 & Min=1) I get nothing.
how do we fix the (if hr=x & min=a, play sound) ?


thechaosengine

  • *
  • Posts: 327
I love this extension but I'm having some issues using it to set up a timed event. I can get as far as grabbing the current timestamp and subtracting the last saved timestamp but I can't figure out where to go from there. Could anyone point me in the right direction to get an "if 3 hours have passed, do something" action working?

Also, displaying a timestamp converted from milliseconds to anything else tends to look like "5.00384739" w a ton of action after the decimal, a way to not have that show up would be great too (I only need hours and minutes as round numbers)

squeeb

  • Posts: 1128
I love this extension but I'm having some issues using it to set up a timed event. I can get as far as grabbing the current timestamp and subtracting the last saved timestamp but I can't figure out where to go from there. Could anyone point me in the right direction to get an "if 3 hours have passed, do something" action working?

Ceosol and I have that in the market set up and working nicely
http://community.stencyl.com/index.php/topic,50022.0.html