Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: escpodgames on January 30, 2014, 12:09:45 AM

Title: Network time
Post by: escpodgames on January 30, 2014, 12:09:45 AM
Hi,

What I need is a universal time value from a server, this is so I can check the time passed since a previous time without relying on the device (which is changeable but the user) there are a bunch of servers like -
http://www.pool.ntp.org/en/

Just wondering if anyone else has tried to take this ... I assume the network actions will be needed.
Title: Re: Network time
Post by: Padenlee on January 03, 2017, 06:45:41 PM
Here is my solution for future humans :)

Use the action WWWPOST or WWWPOST Mobile if on mobile. Have the url point to here:

http://www.timeapi.org/utc/now

This will get you the UTC or Universal Time Clock. You then need to use Get Substring to get the month, day, year, etc into individual strings. Use Build String to recombine the date time into UNIX time which Playmaker actions use :)

Hope this helps!
Title: Re: Network time
Post by: escpodgames on January 03, 2017, 06:48:09 PM
SUPER THANKS! ;D
Title: Re: Network time
Post by: dudebxl on January 04, 2017, 11:40:17 AM
You also have the epoch time actions that might help. They should be on the ecosystem (maybe - snipt gone)

http://hutonggames.com/playmakerforum/index.php?topic=13541.0
Title: Re: Network time
Post by: escpodgames on March 20, 2017, 02:14:20 AM
It appears that http://www.timeapi.org/utc/now is no longer working.

@dudebxl
I have tried to use the Epoch actions but always get back the same time (01/01/1970 13:00) How are these actions used to get the correct time?
Title: Re: Network time
Post by: markmandarin on March 21, 2022, 08:04:53 AM
this is get UTC time action, maybe it helps

https://hutonggames.com/playmakerforum/index.php?PHPSESSID=f8734deef84ce369bd7503e0d96f4f09;topic=24800