Synopsis: |
| getyearfromdate.pl |
| ||
sub GetYearFromDate($)
{
my ($t) = @_;
return (localtime shift)[5] % 100;
}
#-- unit tests
sub test_getyearfromdate()
{
ut::assert(GetYearFromDate(0), 69);
ut::assert(GetYearFromDate(28799), 69);
ut::assert(GetYearFromDate(28800), 70); #28800 seconds is 8 hours
ut::assert(GetYearFromDate(1056523422), 3);
ut::assert(GetYearFromDate(1096523422), 4);
}
1;
|
| Contact me about content on this page using john_web-at-arrizza-dot-com |
| For Web Master or site problems contact: webadmin-at-arrizza-dot-com |
| Copyright John Arrizza (c) 2001-2010 |