Stencyl 3.4.0 is now out. Get it now!

Code Block ; Date UTC

maharadjah

  • Posts: 26
Hello everybody, have a nice day  ;)

i had found an extension that give the date of computer  :(
BUT i would like the dateUTC
to synchronize the creation of a level per day with the date of the scoreboard of NEWGROUND

i found this, with dateUTC
https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html#dateUTC

BUT i can't make the code block work !


if anyone can help me,
thank youit can also be put in stencylforge for everyone
sorry for my bad english, i am French ;-)

TheIndieStation

  • *
  • Posts: 2191
Try removing the UTC part in your code block.

yoplalala

  • *
  • Posts: 1412
Hmmm. You can get the timestamp which is in UTC with Date.now().getTime(). But I would think if you transform to a date it would change it into a local date.

https://groups.google.com/forum/#!topic/haxelang/KcN9yxIsmRg
Indeed no utc time ...

You could calculate some UTC time from the local time.  But it would be difficult, (winter time les heures d'hiver ...).
( been trying for an hour ....)
What happens if the time is not correct on the computer ?
The best way would be to get the UTC time from the internet


If you really want to have UTC dates, you could use this haxe  extension https://lib.haxe.org/p/datetime/

« Last Edit: November 13, 2017, 08:57:10 am by yoplalala »

maharadjah

  • Posts: 26
Quote
What happens if the time is not correct on the computer ?
players can cheat; playing a simpler level
The best way would be to get the UTC time from the internet
That's what I'm trying to do !
I thought that would be my attempt : UTCdate.now ()

Thank you for proposing a solution: "use this haxe extension"

too late for me to try, but I'm afraid that even woke up, I'm not able to do it  :-[
( 23:35 local time  ;) )
sorry for my bad english, i am French ;-)

maharadjah

  • Posts: 26
HELP
is there someone who can make work the code block ?

i realy not be able to use it ( to do nothing  :-[ )

for some one who know, it won't taken too munch time, isn't it ?

                                                                   HELP


sorry for my bad english, i am French ;-)