So I have a collection in gamesparks and a time is saved when an object is added with Date.now(). To my knowledge, that's the same as new Date() and I've tried both with no improvement.
A value I've just saved can be seen in No SQL as
"stageTimeStartUTC": { "$date": { "$numberLong": "1469223798795" } },
and in the Test Harness Inspector as
"stageTimeStartUTC": 1469223798795,
now in unity when using
GetDate("stageTimeStartUTC")
it return Null
but using
result.GetLong("stageTimeStartUTC")
I do get 1469223798795
is this the expected result? How do I get a DateTime? It seems possible since GetDate is available.
I also tried new DateTime((long)result.GetLong("stageTimeStartUTC"), System.DateTimeKind.Utc) but that date was super wrong lol
How about new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(1469223798795);
that does the trick! didnt see that the number represented that. Thanks!
One More Turn
So I have a collection in gamesparks and a time is saved when an object is added with Date.now(). To my knowledge, that's the same as new Date() and I've tried both with no improvement.
A value I've just saved can be seen in No SQL as
"stageTimeStartUTC": { "$date": { "$numberLong": "1469223798795" } },
and in the Test Harness Inspector as
"stageTimeStartUTC": 1469223798795,
now in unity when using
GetDate("stageTimeStartUTC")
it return Null
but using
result.GetLong("stageTimeStartUTC")
I do get 1469223798795
is this the expected result? How do I get a DateTime? It seems possible since GetDate is available.
I also tried new DateTime((long)result.GetLong("stageTimeStartUTC"), System.DateTimeKind.Utc) but that date was super wrong lol
How about new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(1469223798795);
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstDavendra Jayasingam
How about new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(1469223798795);
1 person likes this
One More Turn
that does the trick! didnt see that the number represented that. Thanks!
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics