in reply to Parsing a date time string
Why not fix the time unconditionally?
sub fix_time { my( $time )= @_; $time =~ s/^(\d:\d\d)$/0$1/; return $time };
This replaces (if it finds) the leading single-digit number with a zero-padded number.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing a date time string
by bangor (Monk) on Aug 02, 2014 at 16:56 UTC |