On Thu, 2 Sep 2010, Metz, Bobby wrote:

-----Original Message-----
From: Metz, Bobby
# Grab the year either via exec or via DateTime, your choice
chomp(my $year = `date '+%Y'`);
# --or--
my $year  = strftime('%Y',localtime(time));

My apologies, I said "using DateTime" above but I used a POSIX example instead.

:D

DateTime could be used this way:

my $dt = DateTime->now();
my $year = $dt->strftime("%Y");

Or you could do the simple version ...

 DateTime->now()->year();


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/

Reply via email to