Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getToday = () => {
- const d = new Date();
- const year = d.getFullYear();
- const month = () => {
- if((d.getMonth() + 1).length === 1) {
- return d.getMonth() + 1;
- }
- else {
- return '0' + (d.getMonth() + 1)
- }
- };
- const day = d.getDate();
- const today = `${year}-${month()}-${day}`;
- return today;
- };
- const today = getToday();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement