Get number of seconds from time
Download getsecondfromdate.zip
Synopsis: |
| getsecondfromdate.pl |
| ||
sub GetSecondFromDate($)
{
my ($t) = @_;
return (localtime shift)[1];
}
#-- unit tests
sub test_getsecondfromdate()
{
ut::assert(GetSecondFromDate(0), 0);
ut::assert(GetSecondFromDate(28799), 59);
ut::assert(GetSecondFromDate(28800), 0); #28800 seconds is 8 hours
ut::assert(GetSecondFromDate(1056523422), 43);
ut::assert(GetSecondFromDate(1096523422), 50);
}
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 |