Open
Description
This is a feature request for a method that can add whole days without being affected by daylight savings.
The DateTime add(Duration duration)
method adds seconds. Several issues have been created where developers are confused about the behaviour of the method #37449.
The DateTime
API is well documented, but the question on how to add days without being affected by daylight savings is not well documented. This is also causing issues in third party packages like jiffy jama5262/jiffy#81
Could we either
- Update the documentation to specify how to add whole days, for example like this
DateTime newDate = DateTime(date.year, date.month, date.day + days);
(I don't even know if this is the correct way to do it, some StackOverflow posts mentions that solution) - Get a new method, for example
DateTime addDays(int days)
which is not affected by daylight savings