{"id":475,"date":"2016-03-24T14:32:01","date_gmt":"2016-03-24T05:32:01","guid":{"rendered":"http:\/\/www.takaya-com.jp\/archives\/?p=475"},"modified":"2016-03-24T15:04:59","modified_gmt":"2016-03-24T06:04:59","slug":"javascript_number_day","status":"publish","type":"post","link":"https:\/\/takaya-com.jp\/archives\/2016\/03\/javascript_number_day\/","title":{"rendered":"JavaScript\u3067\u7d4c\u904e\u65e5\u6570\u3092\u8868\u793a\u3057\u307e\u3059\u3002"},"content":{"rendered":"<p><!-- \u672c\u6587 --><br \/>\n\u30bd\u30fc\u30b9\u306e\u4e2d\u306b\u958b\u59cb\u65e5\u3068\u7d42\u4e86\u65e5\u3092\u5165\u529b\u3059\u308b\u3068<br \/>\n\u958b\u59cb\u304b\u3089\u306e\u65e5\u6570\u3001\u7d4c\u904e\u65e5\u6570\u3001<br \/>\n\u3064\u3044\u3067\u306b\u7d42\u4e86\u5f53\u65e5\u306f\u8868\u8a18\u304c\u5909\u308f\u308a\u3001\u7d42\u4e86\u5f8c\u306e\u7d4c\u904e\u65e5\u6570\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\uff08Chrome\u3001Firefox\u3067\u3057\u304b\u52d5\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3001\u3001\u3001\uff09<\/p>\n<p><!--more--><\/p>\n<p>\u2193\u4ee5\u4e0b\u304c\u5b9f\u969b\u306e\u30bd\u30fc\u30b9\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" title=\"\u25bcJavaScript\" >function myCountDown( myYear, myMonth, myDay ){\r\n   myNow   = new Date();\r\n   myRunDate = new Date( myYear , myMonth-1 , myDay );\r\n   myMsec = myNow.getTime() - myRunDate.getTime();\r\n   myDayCount = Math.floor( myMsec \/ (1000*60*60*24) );\r\n   return myDayCount+1;\r\n}<\/pre>\n<pre class=\"lang:xhtml decode:true \" title=\"\u25bcHTML\" >\u958b\u59cb\u65e5\u304b\u3089\u3001\r\n&lt;!-- \u2193\u958b\u59cb\u65e5\u3092\u5165\u529b\uff08\u897f\u66a6\uff09 --&gt;\r\nmyCountUp( \u5e74,\u6708,\u65e5 );\r\n\u65e5\u76ee\u3002\r\n<\/pre>\n<pre class=\"lang:js decode:true \" title=\"\u25bcJavaScript\" >function myCountDown( myYear, myMonth, myDay ){\r\n   myNow   = new Date();\r\n   myRunDate = new Date( myYear , myMonth-1 , myDay );\r\n   myMsec = myNow.getTime() - myRunDate.getTime();\r\n   myDayCount = Math.floor( myMsec \/ (1000*60*60*24) );\r\n   return myDayCount+1;\r\n}<\/pre>\n<pre class=\"lang:xhtml decode:true \" title=\"\u25bcHTML\" >&lt;!-- \u2193\u7d42\u4e86\u65e5\u3092\u5165\u529b\uff08\u897f\u66a6\uff09 --&gt;\r\nmyDay = myCountDown( \u5e74, \u6708, \u65e5 );\r\n\r\nif ( myDay &lt; 0 ) document.write( \"\u7d42\u4e86\u65e5\u307e\u3067\u3001\u3042\u3068\", myDay*(-1), \"\u65e5\u3002\" );\r\nelse if (myDay == 0) document.write( \"\u672c\u65e5\u306f\u7d42\u4e86\u65e5\u3002\" );\r\nelse document.write( \"\u7d42\u4e86\u3057\u3066\u3001\", myDay, \"\u65e5\u7d4c\u904e\u3002\" );\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>\u4eca\u56de\u3001\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u305f\u306e\u306f\u3001<br \/>\n\u300e<a href=\"http:\/\/www.red.oit-net.jp\/tatsuya\/java\/index.htm\">\u300c\u30a4\u30cc\u3067\u3082\u308f\u304b\u308bJavaScript\u8b1b\u5ea7\u300d<\/a>\u300f\u3055\u3093\u3067\u3059\u3002<br \/>\n\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.takaya-com.jp\/archives\/demo\/discharge\/\" target=\"_blank\">\u30c7\u30e2\u30da\u30fc\u30b8\u306f\u3001\u3053\u3061\u3089<\/a><\/p>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30bd\u30fc\u30b9\u306e\u4e2d\u306b\u958b\u59cb\u65e5\u3068\u7d42\u4e86\u65e5\u3092\u5165\u529b\u3059\u308b\u3068 \u958b\u59cb\u304b\u3089\u306e\u65e5\u6570\u3001\u7d4c\u904e\u65e5\u6570\u3001 \u3064\u3044\u3067\u306b\u7d42\u4e86\u5f53\u65e5\u306f\u8868\u8a18\u304c\u5909\u308f\u308a\u3001\u7d42\u4e86\u5f8c\u306e\u7d4c\u904e\u65e5\u6570\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002 \uff08Chrome\u3001Firefox\u3067\u3057\u304b\u52d5\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3001\u3001\u3001\uff09<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts\/475"}],"collection":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/comments?post=475"}],"version-history":[{"count":8,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts\/475\/revisions"}],"predecessor-version":[{"id":485,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/posts\/475\/revisions\/485"}],"wp:attachment":[{"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/media?parent=475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/categories?post=475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/takaya-com.jp\/archives\/wp-json\/wp\/v2\/tags?post=475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}