Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


Javascript time snippets

30 Jul 2022 »
d = new Date(2022,7,1)
//Mon Aug 01 2022 00:00:00 GMT-0300 (GMT-03:00)
d2 = new Date(d.getTime()+24*3600*1000)
//Tue Aug 02 2022 00:00:00 GMT-0300 (GMT-03:00)
d2.getDay()
//2 -> Tuesday
d2.getDate()
//2 -> Aug 2nd

Day 1 -> Monday 2 -> Tuesday 3 -> Wednesday 4 -> Thursday 5 -> Friday 6 -> Saturday 0 -> Sunday