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
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
: 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
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
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
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."
--