Ewen Marshall wrote, on Thursday, September 07, 2006 2:18 PM
: my @date_time = localtime();
...
: my $mysql_today = "$year-$month-$monthday"; # Todays date in mysql
format 
: my $mysql_minus1 = "$year-$month-" . (sprintf("%02d", $monthday - 1));
# yesterdays date in mysql format

I like the suggestion of using the MySQL "INTERVAL" function. But if you
really want to do it in Perl, explicitly get the current time in seconds
before breaking it out with localtime(). Then do manipulations on that
(my $yesterday = $today - 86400;) and break *those* out with localtime()
as well.

Joe

Joseph Discenza, Senior Programmer/Analyst
mailto:[EMAIL PROTECTED]

Carleton Inc. http://www.carletoninc.com
574.243.6040 ext. 300
Fax: 574.243.6060
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to