NAME
Date::ISO - Perl extension for converting dates between ISO and
Gregorian formats.
SYNOPSIS
use Date::ISO;
$iso = Date::ISO->new( iso => $iso_date_string );
$iso = Date::ISO->new( epoch => $epoch_time );
$iso = Date::ISO->new( ical => $ical_string );
$iso = Date::ISO->new( year => $year, month => $month,
day => $day );
$iso_year = $iso->iso_year;
$year = $iso->year;
$iso_week = $iso->iso_week;
$week_day = $iso->iso_week_day;
$month = $iso->month;
$day = $iso->day;
And, for backward compatibility:
($yearnumber, $weeknumber, $weekday) = iso($year, $month, $day);
($yearnumber, $weeknumber, $weekday) = localiso(time);
($year, $month, $day) = inverseiso($iso_year, $iso_week,
$iso_week_day);
DESCRIPTION
Convert dates between ISO and Gregorian formats.
new
my $iso = Date::ISO->new( iso => $iso_date_string );
my $iso = Date::ISO->new( epoch = $epoch_time );
And, since this is a Date::ICal subclass ...
my $iso = Date::ISO->new( ical => $ical_string );
$ical = $iso->ical;
Accepted ISO date string formats are:
1997-02-05 (Feb 5, 1997)
19970205 (Same)
199702 (February 1997)
1997-W06 (6th week, 1997)
1997W06 (Same)
1997-W06-2 (6th week, 2nd day)
1997W062 (Same as above)
1997-035 (35th day of 1997)
1997035 (Same as above)
2-digit representations of the year are not supported at this time.
Time values are not supported at this time.
Backwards compatibiilty methods
The following functional interface is provided for backwards
compatibility with former versions.
iso
$iso = iso($year, $month, $day);
AUTHOR
Rich Bowen (rbowen@rcbowen.com)
DATE
$Date: 2001/08/23 02:04:00 $
Additional comments
For more information about this calendar, please see:
http://personal.ecu.edu/mccartyr/ISOwdALG.txt
http://personal.ecu.edu/mccartyr/isowdcal.html
http://personal.ecu.edu/mccartyr/aboutwdc.htm
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
http://www.fourmilab.ch/documents/calendar/
Finally, many many many thanks to Rick McCarty who provided me with the
algorithms that I'm using for conversions to and from ISO dates. All the
errors in previous versions of this module were entirely my fault for
miscopying something from his algorithm.
To Do, Bugs
Need to flesh out test suite some more. Particularly need to test some
dates immediately before and after the first day of the year - days in
which you might be in a different Gregorian and ISO years.
ISO date format also supports a variety of time formats. I suppose I
should accept those as valid arguments.
Creating a Date::ISO object with an ISO string, and then immediately
getting the ISO string representation of that object, is not giving back
what we started with. I'm not at all sure what is going on.