Logo

Programming-Idioms

History of Idiom 184 > diff from v16 to v17

Edit summary for version 17 by joewrong:
New JS implementation by user [joewrong]

Version 16

2019-09-26, 14:17:34

Version 17

2019-09-26, 16:51:19

Idiom #184 Tomorrow

Assign to variable t a string representing the day, month and year of the day after the current date.

Idiom #184 Tomorrow

Assign to variable t a string representing the day, month and year of the day after the current date.

Code
var currentDate = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
var day = currentDate.getDate()
var month = currentDate.getMonth() + 1
var year = currentDate.getFullYear()
var t = `${day}/${month}/${year}`;
Origin
https://stackoverflow.com/a/9444785