Community Commons - LongToDateTime

0
Is this function working? I’m getting weird results:
asked
4 answers
2

Massimo,

LongToDateTime converts a timestamp in microseconds to a DateTime.  The number you have tried to convert looks like seconds.  I think if you multiply your number by 1,000,000 you will get microseconds which will convert to a DateTime successfully.

Hope that helps,

Mike

answered
0

Yep!, Thank you.

answered
0

That looks right to me, what are you expecting to see?

Is your long number in seconds? If it is, then you need to multiply the number by 1000 before feeding it into LongToDateTime as it expects milliseconds.

UPDATE: My original answer incorrectly said microseconds instead of milliseconds.

 

answered
0

Robert/Mike, suggestions are ok, but LongToDateTime  uses a Unix timestamp in milliseconds (1/1000 second) instead of microseconds (1/1.000.000 second).

answered