Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 65774
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 6.21
Fixed in: (no value)



Subject: Feature request: way to add days
Date::Manip::Problems documents the odd behaviour when adding days to a date crossing a DST boundary. Rather than moving to the next calendar day, Date::Manip adds exactly 24 hours, which can mean a time of 23:00 on the same calendar day. This is clearly documented (if surprising), but it would be useful to have a way to add days that follows the calendar rather than 24-hour intervals. This is analogous to adding 'one month', which is not a fixed number of seconds but varies with the calendar. Perhaps a delta of '+1 calendar day' could be accepted. Similarly, a delta of '+1 solar day' would explicitly indicate that you want a 24 hour period. Then the ambiguous '+1 day' could eventually be deprecated, since it tends to catch people out.
That is already on the list of features that I'm considering. Although it seems like a simple feature, it actually is fairly involved, so I haven't done it (and haven't even decided what priority it is), but I agree that this would avoid some confusing behavior.
Version 6.30 now has this functionality. Use the 'semi' mode in date-date calculations (see the Date::Manip::Calc man page for information). 6.30 will be released within a day or two.