2016-05-27 回答
什么语言实现?
+ ====== 如何在不同编程语言中实现普通时间 → unix时间戳(unix timestamp)? ======
+
+ 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, day, month, 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:m