Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

generate UNIX timestamp from Date

const getTimestamp = (date = new Date()) => Math.floor(date.getTime() / 1000);

getTimestamp(); // 1602162242
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #generate #UNIX #timestamp #Date
ADD COMMENT
Topic
Name
6+9 =