I have a date in the format mm/dd/yy
and want to add 30 days to it. I am just curious the best method to do this? I am new to javascript so examples would be he
React Answer
Some of the Javascript commands are not available in React like getDate(). Also, I find it better to change dates to Unix timestamps so I can compare dates more easily in database searches using a simple mathematical greater than search.
const nowPlus30Days = new Date(Date.now() + (30 * 24 * 60 * 60 * 1000)).getTime() / 1000;
(1597829050.184)
I can compare this to today:
const today = new Date().getTime() / 1000
(1595237050.184)