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; }
In reply to Re: Generating a format template for a date
by jbert
in thread Generating a format template for a date
by bart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |