Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateFormatting removing dashes from output

Status
Not open for further replies.
Jun 3, 2007
84
US
Hello with the code shown below how would I format it to remove the dashes/hyphens from the date?

Code:
my $dt = DateTime->now()->subtract( days => 3 );
my $date = $dt->ymd();
print "$date", "\n";

print 2008-08-02

How would I print the date without the dashes(-)

20080802

thanks
 
Change the second line to:
Code:
my $date = $dt->ymd('');
The argument passed to it specifies the separator.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top