How do I get oficial time working on my game?

Get help using Construct 2

Post » Tue Apr 21, 2015 10:36 pm

I need a time variable outside player control that is the same for him and all the world. After looking on forum it seems my best bet is to get it from something like http://www.time.gov/. BUT HOW?!
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Tue Apr 21, 2015 10:38 pm

@NobalChase this may interest you.
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Wed Apr 22, 2015 7:49 am

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Apr 22, 2015 9:22 am

If you want a date that the user can't mess with, then host it on your server and get it with an ajax request. The script below outputs "2015-04-22 11:17:28", you can also format it into xml / json to assign variable names to seconds, minutes, hours... It'll get the date that is on your sever.

<?php
echo date('Y-m-d H:i:s');
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Thu Apr 23, 2015 11:59 pm

Thanks! @breackzin
B
6
Posts: 31
Reputation: 316


Return to How do I....?

Who is online

Users browsing this forum: Ryan Kocourek and 13 guests