9951 explained code solutions for 126 technologies


javascriptGet a timestamp


var timestamp = Math.floor(Date.now() / 1000);ctrl + c
timestamp

this variable will contain current timestamp

Date.now()

returns timestamp in milliseconds

/ 1000

convert milliseconds to seconds

Math.floor

rounds value to nearest lower integer