using an old release of EPrints software, i've this function EPrints::Time::datestring_to_timet to return an integer number of seconds since 1970
######################################################################
=pod
=item $xhtml = EPrints::Time::datestring_to_timet( $handle, $datevalue )
Returns an interger number of seconds since 1970-01-01:00:00
$datevalue - in the format YYYY-MM-DDTHH:MM:SSZ
=cut
######################################################################
sub datestring_to_timet
{
my( $session, $datevalue, $short ) = @_;
my( $year,$mon,$day,$hour,$min,$sec ) = split /[- :TZ]/, $datevalue;
my $t = timegm_nocheck $sec||0,$min||0,$hour,$day,$mon-1,$year-1900;
return $t;
}
if using with a year far in the future, i got a negative number:
print EPrints::Time::datestring_to_timet(undef, "3017-9-20T12:00:00Z");
result:
-26895412800
what is wrong here?