Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert date time in reactjs

let date1=new Date("2020-06-16T02:55:08.151437Z").toDateString()
console.log(date1)

let date2=new Date("2020-06-16T02:55:08.151437Z").toUTCString()
console.log(date2)

let date3=new Date("2020-06-16T02:55:08.151437Z").toLocaleDateString()
console.log(date3)

let date4=new Date("2020-06-16T02:55:08.151437Z").toLocaleDateString('en-US', {
month: '2-digit',day: '2-digit',year: 'numeric'})
console.log(date4)

let date5=new Date("2020-06-16T02:55:08.151437Z").toString()
console.log(date5)

let date6=new Date("2020-06-16T02:55:08.151437Z").toLocaleString()
console.log(date6)
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #date #time #reactjs
ADD COMMENT
Topic
Name
5+5 =