Want to know how to get date | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Want to know how to get date

on JavaScript eg "02/06/1996" https://www.sololearn.com/discuss/492702/?ref=app

4th Jul 2017, 11:10 AM
Salami Ridwan Ayotunde
Salami Ridwan Ayotunde - avatar
2 Answers
+ 12
// Just a single line var date = new Date( ); But the date will be not printed with your date format, so... add this other methods to get the expected result as output: https://code.sololearn.com/WtA3iTpx783n/?ref=app "date.getMonth() + 1" because months start from zero and we want that January will be 1 rather than 0. For the rest it's pretty understandable, just default methods separated from a slash (/) sign, you can learn them following the Javascript course.
4th Jul 2017, 11:51 AM
Maz
Maz - avatar
4th Jul 2017, 12:06 PM
micha
micha - avatar