Changeset 1956

Show
Ignore:
Timestamp:
09/14/06 17:35:07
Author:
miyagawa
Message:

support human-readable date format like 'tomorrow 1pm'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/timezonecvt

    r1937 r1956  
    44use DateTime; 
    55use DateTime::TimeZone; 
    6 use Date::Parse
     6use Date::Manip
    77use Getopt::Long; 
    88 
     
    1414 
    1515my $date = join ' ', @ARGV or die "Usage: timezonecvt [-f From] [-t To] date\n"; 
    16 my @date = strptime($date); 
     16my @date = localtime(UnixDate(ParseDateString($date), "%s")); 
    1717 
    1818my $dt = DateTime->new( 
     
    2222    day    => $date[3], 
    2323    month  => $date[4] + 1, 
    24     year   => ($date[5] || (localtime)[5]) + 1900, 
     24    year   => $date[5] + 1900, 
    2525    time_zone => $from, 
    2626);