JavaScript TimeSts и строки даты конвертируют коды друг другу (Super Simple)
<html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <script type = "javascript"> // get tremest in in in in ss). Date ());; TimeStamp = TimeStamp/ 1000; // Текущая временная метка: 1403149534console.log («Текущая временная метка:" + timestamp); // Получить временной метки в определенном формате времени var stringtime = "2014-07-10 10:21:12"; /1000; // 2014-07-10 TimeStamp 10:21:12: 1404958872 Console.log (Stringtime + "TimeMapp:" + TimeStAmp2); // Изменение текущего времени на строку формата времени var var var timestamp3 = 140305804; var newdate = new Date () newdate.set (timest3/wreatmp3 * 1000; console.log (newdate.todatestring ()); // wed, 18 июня 2014 г. 02:33:24 Gmt console.log (newdate.togmtstring ()); // 2014-06-18T02: 33: 24.000.000-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18-18: 3: 3: 06-18 console.log (newdate.tojson ()); // 18 июня 2014 г. console.log (newdate.tolocaleDatestring ()); // 18 июня 2014 года в 10:33:24 AM Console.log (newdate.tolocalestring (); // 10:33:24 Console.Log (newdate.toL 18 2014 10:33:24 GMT+0800 (Standard Time) Console.log (newdate.toString ()); // 10:33:24 GMT+0800 (Standard Time) Console.log (newdate.totimestring ()); // Сд, 18 июня 2014 г. 02:33:24 Gmtconsole.log (newdate.toutcstring ()); date.prototype.format = function (format) {var date = {"m+": this.getmonth ()+1, "d+": this.getdate (), "h+": this.gethours (), "m+": this.getdutes (), "sthoursemondsecers (). "q+": math.floor ((this.getmonth ()+3) / 3), "s+": this.getmilliseconds ()}; if (/Dy+)/i.test(format)) {format = format.replace (regexp. $ 1, (this.getfyear () + '') .substr (4 - regexp. $ 1.length)); } for (var k в дату) {if (new regexp ("(" + k + ")"). test (format)) {format = format.replace (regexp. $ 1, regexp. $ 1.length == 1? Дата [k]: ("00" + date [k]). substr (" + date [k]). }} return format;} console.log (newdate.format ('yyyy-mm-dd h: m: s')); </script>Выше приведено полное содержание кода переноса времени и даты конверсии строки JavaScript (Super Simple), предоставленного вам редактором. Я надеюсь, что все будут поддерживать wulin.com ~