Answers for "display current date and time in react js"

0

how to get current date in react js

export function getCurrentDate(separator=''){

let newDate = new Date()
let date = newDate.getDate();
let month = newDate.getMonth() + 1;
let year = newDate.getFullYear();

return `${year}${separator}${month<10?`0${month}`:`${month}`}${separator}${date}`
}
Posted by: Guest on March-10-2021
0

display current date and time in react js

{new Date().toLocaleString() + ""}
Posted by: Guest on October-14-2021

Code answers related to "display current date and time in react js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language