playMaker

Author Topic: Network time  (Read 3015 times)

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Network time
« 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.

Padenlee

  • Junior Playmaker
  • **
  • Posts: 63
  • You can't hit what you don't shoot for!
Re: Network time
« Reply #1 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!
-Paden Pierry
@padenpierry
Apple inc.'s first TV show, EP 1.
Game Dev since 2007
Coolest client: Bridgestone

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Network time
« Reply #2 on: January 03, 2017, 06:48:09 PM »
SUPER THANKS! ;D

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Network time
« Reply #3 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

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Network time
« Reply #4 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?

markmandarin

  • Playmaker Newbie
  • *
  • Posts: 49
Re: Network time
« Reply #5 on: March 21, 2022, 08:04:53 AM »