in reply to Generating a format template for a date
sub convert_format { my $format = shift; # If we have a 4 digit year $format =~ s/9999/YYYY/; # Two cases: if ($format =~ /^Y/) { # Month first $format =~ s/99/MM/; $format =~ s/99/DD/; } else { # Day first $format =~ s/99/DD/; $format =~ s/99/MM/; } # Handle two digit year $format =~ s/99/RR/; return $format; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Generating a format template for a date
by davidrw (Prior) on Oct 13, 2006 at 17:52 UTC | |
by jbert (Priest) on Oct 13, 2006 at 18:01 UTC |