⊗jsPmTmMDSM 328 of 504 menu

Day of next or previous month

Let's find out the day of the week on the first of the previous month. To do this, subtract one from the current month:

let now = new Date(); let date = new Date(now.getFullYear(), now.getMonth() - 1, 1); console.log(date.getDay());

Question: will there be a problem if the current month is January? After all, it has the number 0, and when subtracting one from it, we get minus the first month.

Determine what day of the week was a month ago on the same day of the month as today.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline