java unix时间戳转换
把java时间戳转换成unix时间戳:
Unix timestamp)???JavaScriptvar commonTime = new Date(Date.UTC(year, month - 1, day, hour, minute, second))MySQLSELECT unix_timestamp(time)
时间格式: YYYY-MM-DD HH:MM:SS 或 YYMMDD 或 YYYYMMDD Perl先 use Time::Local 然后 my $time = timelocal($sec, $min, $hour, $day, $month, $year);PHPmktime(hour, minute, second, day, month, year)PostgreSQLSELECT 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')))RubyTime.local(year, month, day, hour, minute, second)SQL ServerSELECT DATEDIFF(s, '1970-01-01 00:00:00', time)Unix / Linuxdate +%s -d"Jan 1, 1970 00:00:01"VBScript / ASPDateDiff("s", "01/01/1970 00:00:00", time)