Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert a date into timestamp in javascript

//Explination 

To get the unix timestamp using JavaScript you need to use the getTime() 
function of the build in Date object. As this returns the number of
milliseconds then we must divide the number by 1000 and round it in 
order to get the timestamp in seconds.

(new Date().getTime()/1000);

// Refrence : https://www.hashbangcode.com/article/convert-date-timestamp-javascript
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #date #timestamp #javascript
ADD COMMENT
Topic
Name
9+2 =