Les horodatages JavaScript et les chaînes de date se convertissent les codes (super simple)
<html xmlns = "http://www.w3.org/1999/xhtml"> <adread> <meta http-equiv = "contenu-type" content = "text / html; charset = utf-8" /> <script type = "text / javascrip Date ()); horodatage = horodatage / 1000; // L'horodatage actuel est: 1403149534Console.log ("L'horodatage actuel est:" + horodat / 1000; // 2014-07-10 L'horodatage de 10:21:12 est: 1404958872 Console.log (Stringtime + "Timestamp:" + Timestamp2); // Changez l'heure actuelle au format temporel String var Timestamp3 = 1403058804; var newdate = new Date (); NewDate.Settime (TimStamp3 * 1000); console.log(newDate.toDateString());// Wed, 18 Jun 2014 02:33:24 GMT console.log(newDate.toGMTString());// 2014-06-18T02:33:24.000Zconsole.log(newDate.toISOSString());// 2014-06-18T02:33:24.000Z console.log (newdate.tojson ()); // 18 juin 2014 console.log (newdate.tolocaledatestring ()); // 18 juin 2014 à 10:33:24 AM Console.log (newdate.tolocalestring ()); // 10:33:24 AM Console.log (newdate.tolocatelitring (); 18 2014 10:33:24 GMT + 0800 (Chine Standard Time) Console.log (newdate.toString ()); // 10:33:24 GMT + 0800 (China Standard Time) Console.log (NewDate.Totimestring ()); // Mer, 18 juin 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.getMinats (), "s +": that.gends (), this.getMinats (), "s +": that.gends (), this.getMinats (), "S +": This.GEDSEDS,) "q +": math.floor ((this.getMonth () + 3) / 3), "S +": this.getMilliseconds ()}; if (/(y+)/i.test(Format)) {format = format.replace (regexp. $ $, (this.getlyar () + '') .substr (4 - regexp. 1.Length)); } pour (var k dans la date) {if (new regexp ("(" + k + ")"). test (format)) {format = format.replace (regexp. }} format de retour;} console.log (newdate.format ('yyyy-mm-dd h: m: s')); </script>Ce qui précède est le contenu complet du code horaire JavaScript et du code de conversion de chaîne de date (super simple) que vous avez été apporté par l'éditeur. J'espère que tout le monde soutiendra wulin.com ~