Try this:

$now = time;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($epoch);
$mon = $mon += 1;
$year = $year += 1900;
$yesterday = sprintf("%02d%02d%04d",$mday,$mon,year);

enjoy.



At 08:24 PM 2/6/2006, Jonathan Dudson wrote:
I am pretty much a newbie when it comes to perl.
 
I am trying to break up either localtime or time so they I end up with three separate variables $date (06) $month(02)  $year(2006)  that I can use in an archiving script.
Someone suggested using date calc but that appears to work with values passed to it that you may already have.
 
Any suggestions would be great.
 
Regards
 
Jay.
 
 
 
 
 
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.2/252 - Release Date: 2/6/2006
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to