Thread: Date Routine
View Single Post
Old Jan 15th, 2007, 11:14 AM   #3
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Subtracting 86400 from the time will work most of the time, but not all of the time. If you need accuracy, use a module like DateTime:

perl Syntax (Toggle Plain Text)
  1. use DateTime;
  2. my $yesterday = DateTime->now->subtract( days => 1 );
Arevos is offline   Reply With Quote