How does js get the second timestamp of the current time?

new Date (). GetTime () this gets a 13-bit timestamp (in milliseconds)
how to get a second timestamp, is it directly divided by 1000? I always thought that if I calculated this way, it would be imprecise to leave out three digits, so I asked

.
Apr.01,2022

this question caught me off guard.


can be directly divided by 1000 and then converted to int type, parseInt (new Date (). GetTime () / 1000); , or Date.parse (new Date ()) / 1000; this is also a second timestamp obtained


isn't it

clipboard.png


is there a problem?
1000 milliseconds is not 1 second (1000x1000)
1500 milliseconds is not 1.5 seconds (1500pp1000)
2000 milliseconds is not 2 seconds (2000mm1000)
is 1000 milliseconds changed to 1000 seconds? Or is it 1.5 seconds?

Menu