Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get utc time

const now = new Date()

// UTC Date String
now.toUTCString() // "Sun, 30 May 2021 14:59:15 GMT"

// ISO String
now.toISOString() // "2021-05-30T14:59:15.449Z"

// Unix timestamp
Math.floor(now / 1000) // 1622386878
 
PREVIOUS NEXT
Tagged: #javascript #utc #time
ADD COMMENT
Topic
Name
1+1 =