Why do I need to multiply unix timestamps by 1000 in JavaScript?

buley picture buley · Jan 13, 2011 · Viewed 10.8k times · Source

I'm sure there's a reason I have to add three zeros to every Unix timestamp in JavaScript in order to get the correct date. Can you tell me why? Is it as simple as milliseconds since the epoch vs. seconds?

Answer

deceze picture deceze · Jan 13, 2011

Because Javascript uses milliseconds internally, while normal UNIX timestamps are usually in seconds.