java |
long epoch = new java.text.simpledateformat("dd/mm/yyyy hh:mm:ss").parse("01/01/1970 01:00:00"); |
javascript |
var commontime = new date(date.utc(year, month - 1, day, hour, minute, second)) |
mysql |
select unix_timestamp(time)
时间格式: yyyy-mm-dd hh:mm:ss 或 yymmdd 或 yyyymmdd
|
perl |
先 use time::local 然后 my $time = timelocal($sec, $min, $hour, $day, $month, $year); |
php |
mktime(hour, minute, second, month, day, year) |
postgresql |
select extract(epoch from date('yyyy-mm-dd hh:mm:ss')); |
python |
先 import time 然后 int(time.mktime(time.strptime('yyyy-mm-dd hh:mm:ss', '%y-%m-%d %h:%m:%s'))) |
ruby |
time.local(year, month, day, hour, minute, second) |
sql server |
select datediff(s, '1970-01-01 00:00:00', time) |
unix / linux |
date %s -d"jan 1, 1970 00:00:01" |
vbscript / asp |
datediff("s", "01/01/1970 00:00:00", time) |