How to get the Server Time?

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How to get the Server Time?

SunnyCat
2017-03-19 08:28:50

I need the sever time.But i cant know how to get it.

Comments

[Deleted User]
2017-03-20 09:15:11

Hi @SunnyCat,

by server time you mean the actual time or a time stamp? I guess getting the actual time is not possible. Getting an up to date server time stamp is possible by calling PhotonNetwork.FetchServerTimestamp();. Afterwards you can access this time stamp by using PhotonNetwork.ServerTimestamp. For more information please take a look at the API page.

Back to top