Is secondsfrom1970 broken?

Hi all,

I’m running into a strange issue with date time where it seem like secondsfrom1970 is returning incorrect results.

Var d1 As DateTime = DateTime.Now
Var seconds As Double = d1.SecondsFrom1970

returns: as pulled from the debugger
1690379092.2629649639129639

Anyone seen this before?

What is wrong?

You may truncate to only get seconds, if you don’t like fraction.

The whole number is seconds. The decimal portion represents nanoseconds. Round or convert to Int64 if you don’t care about the nanoseconds.

What’s incorrect about that? The value you quoted is from this afternoon.