Changes   [plain text]

0.30    2005-12-22


- Expanded and rewrote the docs on date math to try to explain exactly
how works, and in particular cover the problems DST
introduces to various types of date math.  The docs now also include
some specific recommendations on getting sane results from datetime

- Added calendar_duration() and clock_duration() methods to

- Explicitly override the stringification method for
DateTime::Infinite objects.  They now stringify as whatever the IEEE
infinity and negative infinity numbers stringify to on your platform.
On Linux this is "inf" and "-inf". CPAN RT #16632.


- delta_md() and delta_days() did not always return correct values
when crossing a DST change.

- The pure Perl version of the code had a dependency ordering problem
where DateTime::LeapSecond depended on other pure Perl code that
wasn't yet available.  I'm not sure how this ever worked.

- Remove mentions of leap second on 1971-12-31 from the docs, because
there was no leap second that day.  Reported by Mike Schilli.

- If you added a second to a datetime that was on a leap second (like
2005-12-31T23:59:60) it got "stuck" and kept returning the same
datetime.  Reported by Mike Schilli.

- Changes to the tests in 20infinite.t may fix failures seen on some
platforms and with new versions of Test::More (0.62 was known to cause


- The subtract_datetime() method switched back to using the local
portion of the date _and_ time, but it now accounts for days with DST
changes specially.  This produces results that fix the bugs that were
fixed by previous subtraction changes in 0.28 and 0.29, but without
introducing even more bugs.  The overall result should be sane, but
please see the docs for details.

0.2901  2005-07-04

- A leap second for the end of 2005 was announced.

0.29    2005-06-03


- When adding/subtracting a duration with months or days that crossed
a DST change, the result was based on the local time, not the UTC
time.  For consistent results, it is necessary to use the UTC time
(but local date) for all date math.  Reported by J. Alexander Docauer.

0.28    2005-02-27


- The era names for the era() method are now retrieved from the object's associated locale.  The old era() method, which
was hard-coded to use BCE and CE, is renamed secular_era().  The
christian_era() method remains the same.


- Fixed an embarassing bug in the subtract_datetime() method.  It was
subtracting local times, not UTC, which caused bugs when doing
subtraction across a DST change.  This method is used to implement
subtraction overloading, so that was affected as well.  Reported by
Mike Schilli.

- The docs for the %U and %W strftime specifiers implied that these
should be zero-padded, but the code was not doing so.  Reported by J

0.27    2005-01-31


- Added local_rd_values() method for the benefit of other modules like

0.26    2005-01-27


- The docs claimed that the delta_ms(), delta_md(), delta_days()
methods always returned a positive duration, but this was not true for
delta_md() or delta_days().

0.25    2005-01-10 (the "new year, new bugs" release)


- Calling set_time_zone() for a datetime very close to a time zone
change died for many of the Olson time zones.

- The docs for the from_object constructor said that by default, new
objects were in the UTC time zone, but in reality the default was the
floating time zone.  The docs were changed to match the code.  Ticket
9278 on

0.24    2004-12-10 (the "have I mentioned I hate leap seconds" release)


- Fixed even more bugs related to leap seconds and time zones.
Reported by Eugene van der Pijll.


- Offsets with a seconds portion (like "+00:00:30") act strangely near
leap seconds.  Reported by Eugene van der Pijll.  This will be fixed
in a future release.

0.23    2004-12-09 (the "oh how I hate leap seconds" release)


- Added a number of convenience "set" methods: set_year, set_month,
set_day, set_hour, set_minute, set_second, set_nanosecond, and
set_locale.  Suggested by Michael Schwern.

- Added christian_era and year_with_christian_era methods.

- Clarified that from_epoch(), today(), and now() all return objects
in the UTC time zone.  Suggested by Sagar Shah and others.

- Added formatter parameter to constructor, which allows per-object
stringification.  Based on a patch from Daisuke Maki.


- Trying to serialize DateTime::Infinite objects with Storable blew
up.  Patch by Daisuke Maki.

- Require Test::More 0.34+, since I use a function introduced in that
version in the tests.  Suggested by Jean Forget.

- Fix a bug in strftime() which could cause weirdness with
pathological specifiers like "%%{day_name}%n".  Reported by Jean

- Fixed a number of bugs related to leap seconds and time zones.
Reported by Eugene van der Pijll.

0.22    2004-07-23


- The leap second table we were using mistakenly included a leap
second on December 31, 1971.  This will break all versions of the
DateTime::Format::Epoch::TAI64 module up to and including version
0.06.  Most users of will not be affected.  Patch by
Joshua Hoblitt.

0.2101  2004-06-10


- There was a bug in the date math code that occurred if you tried to
add enough days, minutes or seconds to generate a datetime 10 years in
the future (or so).  If the the DateTime object had a a time zone with
recurring DST changes, then the date math operation would cause a
fatal error "Invalid local time for date in time zone ...".  Reported
by Dave Faraldo.

0.21  2004-03-28 (The "Another YAPC::Taipei release party release" release)


- When given mixed positive & negative arguments, DateTime::Duration
no longer forces all arguments to be negative.

- For mixed durations, the is_positive, is_zero, and is_negative
methods all return false.

- Brought back stringification overloading.  As of version 1.06,
Devel::StackTrace will ignore this overloading when displaying a


- Add a new in_units() method to DateTime::Duration.  Patch by Andrew

- Rely on DateTime::TimeZone and DateTime::Locale having their own
Storable hooks, as opposed to handling them in's own
Storable hooks.  This should fix RT ticket #5542, reported by Dan
Rowles (I hope).

- More docs on how date math is done.  See the new section "The
Results of Date Math".


- DateTime::Duration's is_positive, is_zero, and is_negative methods
could incorrectly return true if a duration contained mixed positive
and negative units.

- Better normalization of nanoseconds in DateTime::Duration.  Patch by
Andrew Pimlott.

0.20  2004-02-12


- Tweaked the "How Date Math is Done" section in to
provide some more explicit examples.


- If seconds are not negative, DateTime::Duration will try to keep
nanoseconds >= 0 when normalizing them to seconds, as long as this
doesn't make seconds become negative.  Suggested by Andrew Pimlott.

- In the datetime subtraction code, there was an off-by-one error in
the code to determine if one of the datetimes occurred in a minute
containing a leap second.  This led to the result of the subtraction
being off by one second.  Patch by Andrew Pimlott.

- A duration's nanoseconds weren't normalized after multiplication.
Patch by Andrew Pimlott.

0.1901  2004-01-07  (the "people care about ancient history?" release)


- The day of week was totally busted for dates before 0000-12-25.
Reported by Flavio Glock.

0.19  2003-12-01  (the "never look before a leap second" release)


- DateTime::Duration now provides a compare() class method.

- DateTime::Duration now overloads comparison to throw an exception,
because comparison requires a base DateTime object.  Note that
previous versions of DateTime::Duration _did not_ overload comparison,
so if you were comparing them, you were just comparing the value of
the object references.  Thanks to Rick Measham, Jon Swartz, and Max
Maischein for contributing to the discussion on
about how to implement this feature.

- Added DateTime::Duration->multiply to complement multiplication

- Added a leap_seconds method.

- Added a section to the docs about floating datetimes.

- DateTime::LeapSecond no longer contains code copied from, instead it just uses directly.  Patch by
Joshua Hoblitt.


- DateTime::LeapSecond's leap_seconds() function now returns the
number of leap seconds that have occurred, as opposed to the
difference between TAI and UTC for a given Rata Die day, which is what
it was returning previously.  This means that the values it returns
are 9 second less than the previous version.  This does not affect because it never looke at the actual value, just the
difference between two leap second values, which remains the same.

0.18  2003-10-26  (the "delta, delta, delta, can I help ya, help ya, help ya?" release)


- Added several new methods for calculating the difference between two
datetime objects.  These are delta_md(), delta_days(), and delta_ms().
Each of these methods returns the difference as a duration containing
just certain units.


- Require Pod::Man 1.14+, so that head3/head4 markup doesn't cause
installation to die.


- The local_rd_as_seconds method is deprecated, as it doesn't really
serve much purpose.

0.1705  2003-10-07


- Subtracting one datetime from another was still broken, and my fix
in 0.1704 broke many other subtractions.  Reported by Pierre Denis
again.  Many thanks to Pierre for paying attention.

- Subtracting datetimes where the subtraction crossed a leap second
was also broken.

0.1704  2003-10-07


- Documented the behavior of strftime() when given an invalid format.


- The DateTime::Duration synopsis showed a sign() method that doesn't
exist, so I removed it from the synopsis.  Reported by Flavio Glock.

- Subtracting one datetime from another was seriously broken.  The
values for days & weeks were wrong in many cases.  Reported by Pierre

0.1703  2003-09-22


- truncate( to => 'week' ) caused a fatal error when the beginning of
the week was in the previous month.  Reported by R. Mathews
( #3843).

0.1702  2003-09-18


- Added truncate( to => 'week' ).  Suggested by Flavio Glock.

0.1701  2003-09-15


- If from_epoch was given a fractional epoch with a floating point
value with more than 9 digits after the decimal point, the object
ended up containing a floating point number of nanoseconds.  We now
truncate this number to an integer.  Fixed by Joshua Hoblitt.

- The %V strftime specifier was documented, but not implemented.
Reported by Joshua Hoblitt.

- Test #56 in 03components.t would die with "Invalid offset: -124"
when run with DateTime::TimeZone 0.2502+.  Next time, I'll read my own
docs ;)

0.17  2003-08-29  (the "math is hard" release)


- The default end_of_month mode for negative durations is now
"preserve".  This makes more sense, as the previous default meant that
the following code:

 print DateTime->new( year => 2003, month => 5, day => 31 )->subtract( months => 1 )->ymd;

printed "2003-05-01" as opposed to "2003-04-30".  Thanks to Thomas
Klausner for starting a discussion on this problem.

- The subtract_datetime method now returns different results, as does
subtraction overloading when both sides of the subtraction are
DateTime objects.

The subtract_datetime_absolute method returns results similar to what
was previously returned from subtract_datetime.

Thanks to Matthew McGillis for bringing this up, and Joshua Hoblitt
and Eugene van der Pijll for contributing to the ensuing discussion.


- compare() method is now documented to work with any
other calendar class that provides a utc_rd_values() method.

- Added the subtract_datetime_absolute method.  See the docs for

- Documented the inverse() method in DateTime::Duration.

0.1601  2003-08-07


- On platforms like Win32, where we can't find a finite() or
isfinite() function/macro, the DateTime::LeapSecond code wasn't being
loaded, so many tests failed.  Reported by Ron Hill.

0.16    2003-08-06


- The XS code now implements leap second-related calculations.
However, this is only used on platforms where we can find a usable
finite() or isfinite() function/macro, so it isn't used on Win32.

- This distro has now borged the DateTime::LeapSecond module.  It is
only loaded when the XS leap second code cannot be used.

- Other miscellaneous performance improvements.

0.1503  2003-07-31


- Adding a duration with delta months to an infinite DateTime was
quite broken.  Reported by Eugene van der Pijll.

0.1502  2003-07-31


- XSLoader wasn't the problem on Solaris, so it's back.

- Now loading the XS version of is wrapped in an eval
block.  If it fails with an error about the object version not
matching, the pure Perl version is loaded instead.  This should fix
Solaris.  Thanks to Joshua Hoblitt for identifying this bug.

0.1501  2003-07-30


- Fixed the from_object() method to set the returned object's time
zone to the floating time zone if the source object did not have a
time zone, as specified in the docs.  Previously, the returned
object's time zone was UTC.  Patch by Eugene van der Pjill.

- For this release, at least, the module always uses Dynaloader.  This
is in order to see if this fixes a problem on Solaris where the
install library version of the DateTime .so file is loaded instead of
the newly compiled version in the blib directory.

0.15    2003-07-29


- The utc_rd_values() method now returns nanoseconds in addition to
Rata Die days and seconds.  Based on a patch by Joshua Hoblitt.

- The from_object() method expects objects to return the same values
from their utc_rd_values() methods.  Based on a patch by Joshua Hoblitt.


- Fixed a bug in the pure Perl version of _normalize_tai_seconds that
caused very weird results from datetime math.  This version may be
used on platforms where the XS code compiles, so it can affect quite a
number of systems.  Reported by Dan Sully.

0.1402   2003-07-24


- Fix DefaultLocale method, which didn't work at all.  Reported by
Serge Leger.

0.1401   2003-07-24


- Fix a test failure in 13strftime.t under Perl 5.6.1 (and probably

0.14     2003-07-23


- The DateTime::Language modules are no longer being developed or
distributed as part of the distribution.

Because of this, all "language" parameters should now be replaced by
"locale" parameter.  The "language" parameter is deprecated and will
be removed in a future release.

Also note that locales should be specified via ISO codes, not names
like "English".  The old DateTime::Language names will continue to
work indefinitely, but they load DateTime::Locale objects instead.

Locale-specific data will be returned in utf8 when necessary.

- Similarly, the "language" and "DefaultLanguage" methods are now
deprecated in favor of "locale" and "DefaultLocale".


- DateTime::Duration now returns the object from mutator methods, in
order to make method chaining possible.  Suggested by Ben Bennett.

- If the value for second given to new() is 60 or 61, then it must be
a valid leap second.

- DateTime now uses DateTime::Locale for localization, which allows
for real language and territory based localization.  The locale code
is generated from the ICU project's data, and is much more complete
than the DateTime::Language modules.  However, we are losing
(hopefully only temporarily) support for the various African languages
contributed by Daniel Yacob.  Support for those languages should
return in a future release of DateTime::Locale.

- Support for the '%c', '%x', and '%X' strftime format specifiers,
which output localized date and time strings.

- Added the time_zone_long_name method, primarily for the benefit of

- Added a note to the DateTime::Infinite docs warning that it may not
work well on Win32.


- DateTime::Duration was not consistent in how it handled mixed
positive and negative constructor parameters.  Reported by Ben

0.13     2003-05-05


- DateTime now does more validation of parameters given to
constructors and to the set() method, so bogus values like a month of
13 are a fatal error.

- Added a new constructor, from_day_of_year().

- Added a number of new "get" methods, including era, year_with_era,
hour_1, hour_12, hour_12_0, weekday_of_month, and week_of_month.
Based in part on a patch from Rick Measham.

- Now any object method can be called in strftime format by using
"%{method}" as a format specifier.  Patch from Rick Measham

- Added an is_zero method to DateTime::Duration, for objects of zero

- DateTime->from_epoch will now accept a floating point epoch and turn
the post-decimal portion into nanoseconds.  This was done in order to
interface more accurately with Time::HiRes.

- Added a DateTime->hires_epoch method that returns a floating point
value for epoch, also for compatibility with Time::HiRes.

- now implements Storable hooks to reduce the size of
serialized DateTime objects.  In particular, the contained time zone
object is not serialized along with the DateTime object.

- It is now possible to create arbitrary DateTime::Language subclasses
in any namespace.


- "Fixed" 20infinite.t failures on Windows with 2 icky hacks.  The
first simply doesn't compile the XS code that deals with infinite
numbers on Win32, so the pure Perl version is used instead.  However,
the rest of the XS code is still compiled on Win32.  The other hack is
to simply skip a failing test in 20infinite.t on Win32.  Hopefully,
this will eventually be fixed but given that this is not core
functionality for most users, I'd rather get this release out the door

- Fix epoch() method to work properly with dates greater than 50 years
ago.  Apparently, if Time::Local is given a year less than 100, it
tries to guess the century, and it doesn't do this by simply adding
1900.  Numbers less than 53 (for the year 2003) are treated as being
in the current century.  Ugh.

- Fixed compilation on HPUX.  Patch from Dan Sully.

- The last_day_of_month() method did not accept a nanosecond

- A DT::Duration object created with just nanoseconds was always
positive, regardless of the value given for nanoseconds.

- Fixed a serious bug when subtracting one datetime from another that
could cause the result to be off by up to a second, and negative when
it should be positive.  This was caused by the introduction of
nanoseconds in 0.10.

- A zero length duration reported itself as positive when it should be
neither positive nor negative.

- In Perl 5.6.1/Red Hat Linux 7.2, multiplying a variable with value
zero by -1 gives negative-zero, which breaks tests.

   perl -e ' $x=0; $x*=-1; print $x '


Patch by Flavio Glock.

- Comparing a DateTime::Infinite object to a regular datetime could
cause a fatal error.  Reported by John Peacock.

- Fixed a failure in the 04epoch.t tests on Win32.  Negative epoch
values don't work on Win32.


- The "Portugese" language module has been renamed to "Portuguese".
I'm so embarassed!  Reported by Richard Evans.

- DateTime::Infinite objects no longer die if "set" methods are
called.  Instead, these methods are now no-op methods that simply
return the original object.  This makes these objects more usable when
mixed with regular datetime objects.

- Removed the fractional_second constructor parameter.  It was
incorrectly documented anyway.  The fractional_second _accessor_ is
still there.

- DateTime::Duration objects of zero length no longer return true for

0.12     2003-05-05


- Make sure tests always run with warnings on.

- Fix line that had "$] >= 5.6.0" to be "$] >= 5.006".  This caused
warnings and was just wrong.  Reported by John Siracusa.

- Quiet warnings from pure Perl implementation.

- Quiet warnings from language modules with Unicode when used with
Perl 5.00503.

0.11     2003-05-03


- Moved a little bit of the leap second code to XS, so may
be a tiny bit faster.

- Added name() method to DateTime::Language.  Suggested by Rick

- Use XSLoader with Perl 5.6.0+, which according to ancient
perl5-porters discussions saves some memory.

- Added infinite DateTime objects.  See the DateTime::Infinite docs
for details.


- The %I and %l strftime formats were formatting hours as 0-11, not
1-12 as documented.  Patch by Simon Newton.

- A DateTime::Duration object created only with weeks as a parameter
always was positive.  Fixed by Flavio Glock.


- Because of changes in DateTime::TimeZone 0.13, which this version
now requires, when a local time is ambiguous, the latest UTC time is
used, rather than the earliest, as was done previously.

- The Brazilian language module has been renamed as Portugese.

- Removed DateTime::Duration->compare (which I forgot to document
anyway ;) and comparison overloading for DT::Duration.  There's no
meaningful way to compare 60 days to 2 months.

0.10     2003-04-19 (the "I'm sure the new regime will be spiffy" release)


- Added Tigre language module.  Contributed by Daniel Yacob.

- DateTime::Duration objects now overload multiplication.  Implemented
by Flavio Glock.

- Added support for nanoseconds in and DateTime::Duration.
Implemented by Flavio Glock.

- Added complete support for leap seconds (through use of
DateTime::LeapSecond).  Mostly implemented by Flavio Glock.


- Because of the addition of leap seconds to the mix, we are now
forced to handle seconds separately from minutes when doing date math.
This means that several aspects of the DateTime::Duration API have
changed.  Specifically:

-- There is now an additional delta_minutes() method.
-- The hash returned by the deltas() method now includes a "minutes" key.
-- The seconds delta may be greater than 59.
-- The seconds() method may return a number greater than 59.

0.09     2003-04-05 (the "liberation through violence" release)


- As requested by numerous people, there is now a pure Perl
implementation of included with this distribution.  If you
don't have a C compiler it will be used instead of the XS

- Document how floating time zones are handling in comparisons, and
add the compare_ignore_floating method.  Based on a patch from Eugene
van der Pijll.

- Allow from_epoch(), now(), and today() to accept a time_zone
parameter.  Based on suggestions from Tim Bunce and Joshua Hoblitt.

- Allow extraction of AM/PM string list from DateTime::Language classes.

- Added quarter() and day_of_quarter() methods.  Based on a patch from
Tim Allwine.


- If a datetime had the floating timezone and then set_time_zone was
used to set it to something else, the internal UTC time of the object
was not changed, meaning that its offset could be calculated
incorrectly.  Patch by Eugene van der Pijll.

- If datetime math was done with hours, minutes, or seconds, the
return value of ->epoch would be wrong after this.  Based on report
and patch from Iain Truskett.

0.08     2003-03-21 (the "anti-war" release)


- All set/modify methods now return the datetime object, in order to
make method chaining possible.  Patch by Iain Truskett.

- The _greg2rd and _rd2greg methods have been renamed _ymd2rd and
_rd2ymd, so as to make them look more normal when used in subclasses.

- Added a truncate() method.  Suggested by Flavio Glock.

- Added Swedish language module.  Contributed by Christian Hansen.

- Added language modules for Afar, Amharic, Gedeo, Oromo, Sidama,
Somali, and Tigrinya (Eritrean and Ethiopian), all courtesy of Daniel

- Various doc improvements, including a section on invalid local times.


- The week() method was wrong for many dates.  Reported by Christian

- The last_day_of_month() method had the DateTime class hard-coded in
it.  Reported by Eugene van der Pijll.

- Fixed a bug when comparing a datetime object to infinity (or
negative infinity).  Fixed by Flavio Glock.

- Date math has been fixed so that it affects the _local_ times.  This
means that sometimes 1 day is not equal to 24 hours when the
addition/subtraction crosses over a Daylight Saving Time change.  See
the "How Date Math is Done" section of the docs for more details.


- Objects constructed via the new() method now have a "floating" time
zone by default, instead of using the "local" time zone.  This is just
simpler to deal with, and for code where time zones are unimportant,
this is the most appropriate default.

0.07     2003-02-26


- Added a small hack to the compare() method so that this module can
be used with Set::Infinite.

- Changed compare so that it can be used to compare two objects from
different calendars that conform to the DateTime::Calendar interface.

- Added explanation of exactly what calendar this module represents
("proleptic Gregorian calendar") to docs.

- Added a Spanish language DateTime::Language subclass.  Implemented
by Flavio S. Glock.

- Added support for specifying a language by ISO code ("en" or
"pt-br") as well as the subclass name.  Based on a patch from Eric

- Revamped the externally visible DateTime::Language API.

- Objects created via the from_object() method are set to the time
zone of the object from which they were created, if it has one, or UTC


- The from_object() method was broken because it retrieved a UTC
datetime from the object passed in, and then created a new DateTime
object using that UTC time as a _local_ time.


- Removed stringification overloading.  Having this in place made it
impossible to create a strack trace in much of the time zone code.

- Renamed the DateTime::Language->subclasses method as languages.

- It is no longer possible to directly instantiate a
DateTime::Language subclass, instead use:

  my $en = DateTime::Language->new( language => 'English' );

- The from_object() method no longer accepts a "time_zone" parameter.

0.06     2003-02-16

- The docs said that there was no year 0 in the Gregorian calendar,
but that was wrong.  The year() method can now return 0.  The year_0()
method has been removed.

- Added jd() and mjd() methods.

- Re-implemented some of the core code in XS for speed.

0.05     2003-02-13

- Fix handling and reporting of epoch times.  Epoch times are, by
definition, UTC times, so any time created from an epoch should always
have its time zone set to "UTC".  This can be changed after the object
is created.  Similarly, value returned by the epoch() method needs to
be based on the object's UTC time, not it's local time.  Bug reported
by Kellan Elliott-McCrea.

- Change year_0 so that -1 BCE is 0, not 1 CE.  This corresponds to
astronomical years.

- Change ymd, dmy, mdy, and iso8601 to use Gregorian years (..., -2,
-1, 1, 2, ... ) as opposed to astronomical years.  Also make sure all
negative years are formatted as 4 digits.

0.04     2003-02-10

- Explicitly set time zone for objects created during tests.

0.03     2003-02-09

- Giving a language parameter to a constructor method didn't load the
language class.

- Test that all language classes are at least loadable.

- Added Brazilian (not quite a language ;) and Danish, again stolen
from Graham Barr's TimeDate suite.

- Added is_dst method.  Requested by Matt Sergeant.

0.02     2003-02-09

- Fixed a bug in calculating day of year in leap years (it was +1 off
starting in February).  Reported by Matt Sergeant.

- Subtracting one datetime from another was broken in most cases.
Improved the tests for this quite a bit.  Reported by Eric Cholet.

- Made the version number a non-dev-release so it's visible when tries to install it as a prereq for something else.

0.01_00  2003-02-04

- The first alpha release.  This module draws on Date::ICal for much
of its internals, so it has more history than a normal alpha release.