How would I get the 'seconds' from this site?

Hey there folks

I need to be able to reference a time online so my users cant change the time on their pc/phones and cheat the system.

Ive googled around but im not familiar with this kinda stuff so my research hasnt gotten me very far.

What is the best way to do this?
Im guessing some sort of script hosted on my own server?

More than likely your web server supports PHP. (If not, figure out what server-side languages it DOES support). You basically should create a page that does nothing but output the current time. This page describes how to do that in PHP.

On the Unity end, you’ll then use the WWW class to load this page. Parse its .text (probably just use System.DateTime.Parse, just to keep it simple). Then you can compare that with System.DateTime.Now to see how far off the user’s machine clock is from your server clock (or just ignore the system clock altogether and treat your server time as authoritative).

I would add that, you should mantain a list of sites your game will check for the time - you never know when the main server will be offline. You dont want that stopping or crashing your game.

Also, remember to handle times when you player is offline. (No signal on mobile for example).