{"id":1464,"date":"2013-10-25T16:45:13","date_gmt":"2013-10-25T07:45:13","guid":{"rendered":"https:\/\/www.united-bears.co.jp\/blog\/?p=1464"},"modified":"2013-10-25T16:45:13","modified_gmt":"2013-10-25T07:45:13","slug":"unix-time-%e3%81%a8%e6%97%a5%e6%99%82%e8%a1%a8%e8%a8%98%e5%9c%b0%e6%96%b9%e6%99%82%e3%81%ae%e7%9b%b8%e4%ba%92%e5%a4%89%e6%8f%9b","status":"publish","type":"post","link":"https:\/\/www.united-bears.co.jp\/blog\/archives\/1464","title":{"rendered":"UNIX time \u3068\u65e5\u6642\u8868\u8a18(\u5730\u65b9\u6642)\u306e\u76f8\u4e92\u5909\u63db"},"content":{"rendered":"<p><script type=\"text\/javascript\" src=\"\/blog\/wp-includes\/js\/jquery\/jquery.js\"><\/script><br \/>\n<script type=\"text\/javascript\">\njQuery(document).ready(function(){\nvar WEEK_DAY = ['\u65e5', '\u6708', '\u706b', '\u6c34', '\u6728', '\u91d1', '\u571f', '\u65e5'];\nvar now = new Date();\njQuery('#unixtime_now').html(now.getTime());\njQuery('#localtime_now').html(\nnow.getFullYear() + '\/' +\n('0' + (now.getMonth() + 1)).slice(-2) + '\/' +\n('0' + now.getDate()).slice(-2) +\n'(' + WEEK_DAY[now.getDay()] + ') ' +\n('0' + now.getHours()).slice(-2) + ':' +\n('0' + now.getMinutes()).slice(-2) + ':' +\n('0' + now.getSeconds()).slice(-2) + '.' +\n('000' + now.getMilliseconds()).slice(-3)\n);\njQuery('#show_unixtime').click(function() {\nvar result = jQuery('#unixtime_result');\nresult.html('');\nvar input = jQuery('#unixtime').val();\nif(!input) {\nresult.html('\u30df\u30ea\u79d2\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002');\nreturn;\n}\nvar date = new Date(parseInt(input, 10));\nresult.html(\ndate.getFullYear() + '\/' +\n('0' + (date.getMonth() + 1)).slice(-2) + '\/' +\n('0' + date.getDate()).slice(-2) +\n'(' + WEEK_DAY[date.getDay()] + ') ' +\n('0' + date.getHours()).slice(-2) + ':' +\n('0' + date.getMinutes()).slice(-2) + ':' +\n('0' + date.getSeconds()).slice(-2) + '.' +\n('000' + date.getMilliseconds()).slice(-3)\n);\n});\njQuery('#show_localtime').click(function() {\nvar result = jQuery('#localtime_result');\nvar year = parseInt(jQuery('#year').val(), 10);\nif(!year) {\nresult.html('\u5e74\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002');\nreturn;\n} else {\nyear = parseInt(year, 10);\n}\nvar month = jQuery('#month').val();\nif(!month) {\nmonth = 0;\njQuery('#month').val(month + 1);\n} else {\nmonth = parseInt(month, 10) - 1;\n}\nvar date = jQuery('#date').val();\nif(!date) {\ndate = 1;\njQuery('#date').val(date);\n} else {\ndate = parseInt(date, 10);\n}\nvar hours = jQuery('#hours').val();\nif(!hours) {\nhours = 0;\njQuery('#hours').val(hours);\n} else {\nhours = parseInt(hours, 10);\n}\nvar minutes = jQuery('#minutes').val();\nif(!minutes) {\nminutes = 0;\njQuery('#minutes').val(minutes);\n} else {\nminutes = parseInt(minutes, 10);\n}\nvar seconds = jQuery('#seconds').val();\nif(!seconds) {\nseconds = 0;\njQuery('#seconds').val(seconds);\n} else {\nseconds = parseInt(seconds, 10);\n}\nvar millseconds = jQuery('#millseconds').val();\nif(!millseconds) {\nmillseconds = 0;\njQuery('#millseconds').val(millseconds);\n} else {\nmillseconds = parseInt(millseconds, 10);\n}\nresult.html(new Date(year, month, date, hours, minutes, seconds, millseconds).getTime());\n});\n});\n<\/script><br \/>\n\u30df\u30ea\u79d2\u8868\u8a18\u306e<a href=\"http:\/\/ja.wikipedia.org\/wiki\/UNIX%E6%99%82%E9%96%93\" target=\"_blank\">UNIX time<\/a>\u3068\u3001\u65e5\u6642\u8868\u8a18(\u5730\u65b9\u6642)\u3092\u76f8\u4e92\u5909\u63db\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002Google \u3067\u691c\u7d22\u3059\u308c\u3070\u305f\u304f\u3055\u3093\u51fa\u3066\u304d\u307e\u3059\u304c\u3001\u5fc5\u8981\u306a\u3068\u304d\u306f\u306a\u305c\u304b\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u306e\u3067 JavaScript \u7248\u3092\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u73fe\u5728\u306e\u6642\u523b<\/strong><br \/>\nUNIX time \u3067<span id=\"unixtime_now\"><\/span>\u3067\u3059\u3002<br \/>\n\u65e5\u6642\u8868\u8a18(\u5730\u65b9\u6642)\u3067<span id=\"localtime_now\"><\/span>\u3067\u3059\u3002<\/p>\n<h2>UNIX time \u304b\u3089\u65e5\u6642\u8868\u8a18(\u5730\u65b9\u6642)\u3078\u306e\u5909\u63db<\/h2>\n<p><input type=\"text\" id=\"unixtime\" size=\"18\" maxlength=\"13\"\/><input type=\"button\" value=\"\u8868\u793a\" id=\"show_unixtime\"\/><\/td>\n<p><span id=\"unixtime_result\">&nbsp;<\/span><\/p>\n<h2>\u65e5\u6642\u8868\u8a18(\u5730\u65b9\u6642) \u304b\u3089 UNIX time \u3078\u306e\u5909\u63db<\/h2>\n<p><input type=\"text\" id=\"year\" size=\"9\" maxlength=\"4\"\/>\u5e74<input type=\"text\" id=\"month\" size=\"7\" maxlength=\"2\"\/>\u6708<input type=\"text\" id=\"date\" size=\"7\" maxlength=\"2\"\/>\u65e5<br \/>\n<input type=\"text\" id=\"hours\" size=\"7\" maxlength=\"2\"\/>\u6642<input type=\"text\" id=\"minutes\" size=\"7\" maxlength=\"2\"\/>\u5206<input type=\"text\" id=\"seconds\" size=\"7\" maxlength=\"2\"\/>\u79d2&nbsp;<input type=\"text\" id=\"millseconds\" size=\"8\" maxlength=\"3\"\/><input type=\"button\" value=\"\u8868\u793a\" id=\"show_localtime\"\/><br \/>\n<span id=\"localtime_result\">&nbsp;<\/span><\/p>\n<p>\u203bUNIX time\u306f\u30011970\/1\/1 00:00:00(UTC)\u304b\u3089\u306e\u30df\u30ea\u79d2\u5358\u4f4d\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30df\u30ea\u79d2\u8868\u8a18\u306eUNIX time\u3068\u3001\u65e5\u6642\u8868\u8a18(\u5730\u65b9\u6642)\u3092\u76f8\u4e92\u5909\u63db\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002Google \u3067\u691c\u7d22\u3059\u308c\u3070\u305f\u304f\u3055\u3093\u51fa\u3066\u304d\u307e\u3059\u304c\u3001\u5fc5\u8981\u306a\u3068\u304d\u306f\u306a\u305c\u304b\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u306e\u3067 JavaScript \u7248\u3092\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u73fe\u5728 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1464","post","type-post","status-publish","format-standard","hentry","category-tools"],"_links":{"self":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=1464"}],"version-history":[{"count":20,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1464\/revisions"}],"predecessor-version":[{"id":1486,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1464\/revisions\/1486"}],"wp:attachment":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=1464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=1464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=1464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}