[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] quickie: GMT time via Date::Calc



$ cat j.pl
use Date::Calc qw( Today_and_Now );

printf("Local: %4d-%2d-%2d %2d:%2d:%2d\n", Today_and_Now);
printf("GMT:   %4d-%2d-%2d %2d:%2d:%2d\n", Today_and_Now(1));

$ perl j.pl
Local: 2005-11-30 11:49:26
GMT:   2005-11-30 17:49:26

I tried to figure out how to do that w/ Class::Date and couldn't in 60
seconds so fell back to Date::Calc. Date::Calc is great, it's just not
as slick as Class::Date objects for comparing/manipulating datetimes.

j