in reply to [ DateTime::Duration ] off by one problem with negative seconds
If I were to supply a value for nano- or microsecond, I would have thought that an integer would have been sufficient, and not to have supply a string for the value.
few minutes later ... From the pod with original emphasis (untested if this would solve the issue):
DateTime::Duration->new( ... )
This method takes the parameters "years", "months", "weeks", "days", "hours", "minutes", "seconds", "nanoseconds", and "end_of_month". All of these except "end_of_month" are numbers. If any of the numbers are negative, the entire duration is negative.
All of the numbers must be integers.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: [ DateTime::Duration ] off by one problem with negative seconds
by LanX (Saint) on Dec 28, 2019 at 02:18 UTC | |
by LanX (Saint) on Dec 28, 2019 at 03:58 UTC |
In Section
Seekers of Perl Wisdom