Hi this is incredibly simple i cant believe im asking this.
I have tried the following:
Moment.now()
Date.now()
new Date().valueOf()
And various other tricks found in other stack overflow questions
They all give me the time in microseconds.
e.g
1543409290654
which is 09/10/50878 @ 10:57am (UTC)
Im aware i could divide by 1000 but surely there is an api in javascript to get the unix timestamp in milliseconds.
Ive have seen this in chrome and react native
EDIT:
So i realise my stupidity i was putting the unix timestamp into a website that renders it as an ISO date but it was expecting seconds which is why i thought my dates were coming in as milliseconds
Date.now() returns the number of milliseconds since midnight January 1, 1970
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With