RE: Date Problem minus-ing a day

2005-08-03 Thread Denham Eva
use strict; use warnings; use POSIX; my $day = strftime '%d%m%Y', localtime; print today $day\n; $day = strftime '%d%m%Y', localtime (time - 86400); print yesterday $day\n; __END__ Thank You Bill This solution worked great. Denham

Date Problem minus-ing a day

2005-08-01 Thread Denham Eva
Hello All I am trying to use the following to capture the date in the format day+month+year ie 01082005. Here is my code: my $day = (strftime('%d%m%Y', localtime()) ); However as this is a program to check a log with the filename format filename01082005.log, I need to minus a day ie

RE: Date Problem minus-ing a day

2005-08-01 Thread Ari.Wilen
: Date Problem minus-ing a day Hello All I am trying to use the following to capture the date in the format day+month+year ie 01082005. Here is my code: my $day = (strftime('%d%m%Y', localtime()) ); However as this is a program to check a log with the filename format filename01082005.log, I need

Re: Date Problem minus-ing a day

2005-08-01 Thread $Bill Luebkert
Denham Eva wrote: Hello All I am trying to use the following to capture the date in the format day+month+year ie 01082005. Here is my code: my $day = (strftime('%d%m%Y', localtime()) ); However as this is a program to check a log with the filename format filename01082005.log, I

Re: Date Problem minus-ing a day

2005-08-01 Thread Joseph C. Bautista
dunno about posix but this might help you... my $TimeStamp = getTimeStamp('sec', time - (24*60*60)); # 1 day = (24*60*60) print $TimeStamp \n; sub getTimeStamp{ my ($str, $time) = @_; my @dt = localtime($time); my $year = $dt[5]+1900; $year = ($year); my $month = $dt[4]+1; if

Re: Date Problem minus-ing a day

2005-08-01 Thread eric clark
Use the Time::Local funtion and transfer the date into epoch seconds. Minus the number of seconds in a day and transfer back to a date format. Search the archives, I think this has been covered recently. Eric "I'd take you seriously but to do so would be an affront to your intelligence." --