Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use DateTime;
    ...
    my $date = 'Wednesday, May 20, 2009 2:09 PM';
    my $dt = DateTime::Format::Flexible->parse_date_time( $date );
    print 'The day of year is ', $dt->day_of_year(), "\n";
    
  2. or download this
    #!/usr/bin/perl
    use Date::Calc qw( Day_of_Year );
    print 'The day of year is ', Day_of_Year(2009, 5, 20), "\n";