Adding a month appears to be adding 30 days?
See original GitHub issueThis code in ts-node:
import { add } from 'date-fns';
let date = new Date('2020-07-01');
console.log(date);
let next = add(date, { months: 1 });
console.log(next);
Outputs the following:
2020-07-01T00:00:00.000Z
2020-07-31T00:00:00.000Z
When adding 1 month, my expectation was that 07-01 would become 08-01. What am I missing here? Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Add or subtract dates - Microsoft Support
Add or subtract days, months, or years from a date by using a formula or date functions in Excel.
Read more >Date Calculator: Add to or Subtract From a Date
Enter a start date and add or subtract any number of days, months, or years. ... See how long remains before a deadline...
Read more >How to add and subtract dates in Excel - Ablebits
See how to quickly subtract or add two dates, add days to a date, add or subtract weeks, months and years, and calculate...
Read more >How to Add Months to or Subtract Months From a Date in Excel
Download the featured file here: https://www.bluepecantraining.com/how-to- add - months -to-or-subtract- months -from-a-date-in-excel/In this ...
Read more >How to Add Days to Dates in Excel - YouTube
In this video we look at 3 different ways to add or subtract days to dates in Excel using formulas, copy & paste,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually it was as simple as setting the timezone to utc for the node process. Thank you so much for your help!
Thanks!