question

Jacky Chou avatar image
Jacky Chou asked

Date().getTime() vs server.GetTime()

Hello,

I log new Date().getTime() and new Date(Date.parse(server.GetTime({}).Time)) out.

They are the same value, is there any actual difference?

Because I don't want to waste an api call if the result is always the same.

Thank you very much.

,

I log new Date().getTime() and new Date(Date.parse(server.GetTime({}).Time)) out.

They are the same value, is there any actual difference?

Because I don't want to waste an api call if the result is always the same. Thank you very much.

apisCloudScript
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

·
Seth Du avatar image
Seth Du answered

In most circumstances, they are the same. If you are getting the time on a secure server, I don’t think it necessary to use this API call. getTime API is included both in client and server API set and is designed to help clients to get PlayFab server time, or when on an external server that can only send/receive HTTP request/response.

In addition, PlayFab getTime API will always return the time in UTC.

1 comment
10 |1200

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

Jacky Chou avatar image Jacky Chou commented ·

thank you! : )

0 Likes 0 ·

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.