Palm::Progect::Date - utility routines for converting dates
use Palm::Progect::Date; $date_due = parse_date('2038/12/31', 'yyyy/mm/dd'); $date_due = parse_date('12-31-38', 'mm-dd-yy'); my $formatted_date = format_date($time_in_unix_format, 'yyyy/mm/dd');
These routines are used by the Palm::Progect::* modules to parse and format dates.
Palm::Progect::*
Given a time in Unix format (i.e. seconds since the epoch), return a string representation of the date based on the given format:
my $formatted_date = format_date($time_in_unix_format, 'yyyy/mm/dd'); print format_date(0, 'yyyy-mm-dd'); # prints "1969-12-31"
The format can include the following symbols:
Four digit year
Last two digits of year
Month number
Day number
Attempt to parse $date_string as a textual representation of a date, using template supplied in $date_format:
$date_string
$date_format
my $time = parse_date('2038/10/24', 'yyyy/mm/dd') print parse_date('12-31, 1969', 'mm-dd, yyyy'); # prints 0
No attempt is made to guess the format of $date_string; it is assumed that you know its format.
$date_format can include the following symbols:
The two digit date format will fail for dates before 1950 or after 2049 :).
Michael Graham <mag-perl@occamstoothbrush.com>
Copyright (C) 2002-2005 Michael Graham. All rights reserved. This program is free software. You can use, modify, and distribute it under the same terms as Perl itself.
The latest version of this module can be found on http://www.occamstoothbrush.com/perl/
progconv
Palm::PDB(3)
http://progect.sourceforge.net/
To install Palm::Progect, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Palm::Progect
CPAN shell
perl -MCPAN -e shell install Palm::Progect
For more information on module installation, please visit the detailed CPAN module installation guide.