Answer the question
In order to leave comments, you need to log in
How to get today's number in React JS?
How do you get today's Date.now() number in React in this format '11-11-1998'?
Answer the question
In order to leave comments, you need to log in
var dateNow = new Date();
var timeString = (dateNow.getDate()<10?'0'+dateNow.getDate():dateNow.getDate())+'-'+(dateNow.getMonth()+1<10?'0'+(dateNow.getMonth()+1):dateNow.getMonth()+1)+'-'+dateNow.getFullYear();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question