就是 seconds since 1970-01-01 00:00:00 UTC
use Time::Local; my ($sec,$min,$hour,$mday,$mon,$year) = (00,33,23,18,07,2013); $mon--; $year-=1900; print my $time = timelocal($sec,$min,$hour,$mday,$mon,$year);
驗證
date -d @1374117071 +%F' '%T
就是 seconds since 1970-01-01 00:00:00 UTC
use Time::Local; my ($sec,$min,$hour,$mday,$mon,$year) = (00,33,23,18,07,2013); $mon--; $year-=1900; print my $time = timelocal($sec,$min,$hour,$mday,$mon,$year);
驗證
date -d @1374117071 +%F' '%T
留言