question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

Is getTime reliable?

Hello,

I have never come across a problem so far, but I was wondering if getTime is reliable? I don't know the infrastructure of PlayFab, but can this code sometimes return different time depending on the servers' locations?

var now = new Date().getTime();

// ... check time
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Rick Chen avatar image
Rick Chen answered

I don’t think it returns different time depending on server’s location. You can refer to this JavaScript document: Date.prototype.getTime(), where it says, getTime() always uses UTC for time representation.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.