Get One Month Ago Date

PHOTO EMBED

Tue Mar 22 2022 20:48:17 GMT+0000 (Coordinated Universal Time)

Saved by @tcovington #javascript #date

const today = new Date()
const oneMonthAgo = new Date(today.getFullYear(), today.getMonth() - 1, today.getDate())
content_copyCOPY

Do you need to get a date from last month? Here you go!

https://bobbyhadz.com/blog/javascript-get-first-day-of-previous-month#:~:text=To%20get%20the%20first%20day,and%201%20for%20the%20day.