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 Rhinorhino 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.
Joined
Jun 3, 2007
Messages
84
Location
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.
 
Cool that works thanks a lot for the quick reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top