Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getdate(year, month, day) {
- let date = new Date(year, month - 1, day);
- date.setDate(date.getDate() - 1);
- let theYear = date.getFullYear();
- let theMonth = date.getMonth() + 1;
- let theDay = date.getDate();
- console.log(theYear + '-' + theMonth + '-' + theDay);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement