I would recommend against a two-digit year, but if you must, see DateTime's strftime method:
use warnings; use strict; use DateTime; my $start_of_week = DateTime->today()->truncate( to => 'week' ); for ( 0..6 ) { my $teden = $start_of_week->clone()->add( days => $_ ); print $teden->strftime('%m-%d-%y'), "\n"; } __END__ 03-11-19 03-12-19 03-13-19 03-14-19 03-15-19 03-16-19 03-17-19
In reply to Re: Two digit year with DateTime?
by haukex
in thread Two digit year with DateTime?
by mitabrev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |