question

Dylan Hunt avatar image
Dylan Hunt asked

How to convert from PlayFab (Unix?) timestamp to simple C#?

"Timestamp": "2014-04-06T00:00:00Z",

Is this a Unix timestamp?

How can I convert this with C# (for Unity) to a simple date, such as 04/06/2014?

I tried to Google this but it's pretty tough ha

apis
10 |1200

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

Dylan Hunt avatar image
Dylan Hunt answered

Figured it out:

// October 3, 2016
Timestamp.ToString("MMMM dd, yyyy");
10 |1200

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

brendan avatar image
brendan answered

It's the Universal Sortable Datetime format (https://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.universalsortabledatetimepattern(v=vs.110).aspx). In PlayFabUtil.cs, we provide the different versions of this format as DefaultDateTimeFormats. What's the call you're making, specifically? If the timestamp isn't be converted correctly by the deserializer, that would be a bug we'd like to fix.

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.

Dylan Hunt avatar image Dylan Hunt commented ·

Not a bug, just having trouble converting ;) was mostly looking for a tip

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.