Recreating PHP's time() function in JavaScript

Recreating PHP’s time() function in JavaScript

PHP’s time() function returns the current unix timestamp. JavaScript doesn’t exactly have the same functionality, but it’s pretty close. Put a different and more understandable way, it returns the current time measured in seconds since the Unix Epoch (00:00:00 UTC on 1 January 1970).

JavaScript has a similar way of getting the time but it’s in milliseconds since the Unix Epoch.