Help for this page

Select Code to Download


  1. or download this
    my $format = DateTime::Format::Strptime->new(
        pattern   => '%Y-%m-%d %H:%M:%S',
    ...
    
    my $min_start = DateTime->new( year => 2007, month => 5, day => 1, tim
    +e_zone => 'local' );
    my $max_stop  = DateTime->new( year => 2008, month => 5, day => 1, tim
    +e_zone => 'local' );
    
  2. or download this
    my $start = $format->parse_datetime(...);
    my $stop  = $format->parse_datetime(...);
    ...
    my $dur = $start->delta_ms($stop);
    
    printf("%d minutes and %d seconds\n", $dur->in_units(qw( minutes secon
    +ds ));