{"id":564,"date":"2002-09-13T03:00:40","date_gmt":"2002-09-13T03:00:40","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=564"},"modified":"2002-09-13T03:00:40","modified_gmt":"2002-09-13T03:00:40","slug":"php%ec%9d%98-date-%ec%9e%90%eb%b0%94%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8%eb%a1%9c","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=564","title":{"rendered":"php\uc758 date() => \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\ub85c"},"content":{"rendered":"<p>\uae00\uc4f4\uc774:\ubd81\uadf9\uacf0   <\/p>\n<p>\n\uc774\ubc88\uc5d0 \uc88b\uc544\uc9c4 \uc810\uc774\ub77c\uba74 \ucd9c\ub825\ud615\uc2dd\uc5d0 html \ud0dc\uadf8\ub97c \ub123\uc744 \uc218 \uc788\uac8c \ub418\uc5c8\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4.<br \/>\n< \uc640 > \uc0ac\uc774\uc5d0 \uc788\ub294 \uac83\ub4e4\uc740 \ubaa8\ub450 \ubcc0\ud658\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud588\uac70\ub4e0\uc694.<br \/>\n\uc9dd\uc774 \uc548\ub9de\uc73c\uba74 \uace4\ub780\ud558\ub2c8\uae50 \uc870\uc2ec\ud558\uc2dc\uad6c\uc694 ^^; <br \/>\n\ud0dc\uadf8 \ubc14\uae65\uc5d0\uc11c\ub294 \ud574\ub2f9\ud558\ub294 \uc601\ubb38\uc790\ub9cc \ubcc0\ud658\ud558\ubbc0\ub85c \uc815\ud655\uc131\ub3c4 \ub192\ud614\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\/\/ \ub0a0\uc9dc,\uc2dc\uac04 format \ud568\uc218 = php\uc758 date()<br \/>\nfunction date(arg_format, arg_date) {<br \/>\n       if(!arg_date) arg_date = new Date();<\/p>\n<p>       var M = new Array(&#8220;Jan&#8221;,&#8221;Feb&#8221;,&#8221;Mar&#8221;,&#8221;Apr&#8221;,&#8221;May&#8221;,&#8221;Jun&#8221;,&#8221;Jul&#8221;,&#8221;Aug&#8221;,&#8221;Sep&#8221;,&#8221;Oct&#8221;,&#8221;Nov&#8221;,&#8221;Dec&#8221;);<br \/>\n       var F = new Array(&#8220;January&#8221;,&#8221;February&#8221;,&#8221;March&#8221;,&#8221;April&#8221;,&#8221;May&#8221;,&#8221;June&#8221;,&#8221;July&#8221;,&#8221;August&#8221;,&#8221;September&#8221;,&#8221;October&#8221;,&#8221;November&#8221;,&#8221;December&#8221;);<br \/>\n       var K = new Array(&#8220;\uc77c&#8221;,&#8221;\uc6d4&#8221;,&#8221;\ud654&#8221;,&#8221;\uc218&#8221;,&#8221;\ubaa9&#8221;,&#8221;\uae08&#8221;,&#8221;\ud1a0&#8221;);<br \/>\n       var k = new Array(&#8220;\u65e5&#8221;,&#8221;\u6708&#8221;,&#8221;\u706b&#8221;,&#8221;\u6c34&#8221;,&#8221;\u6728&#8221;,&#8221;\uf90a&#8221;,&#8221;\u571f&#8221;);<br \/>\n       var D = new Array(&#8220;Sun&#8221;,&#8221;Mon&#8221;,&#8221;Tue&#8221;,&#8221;Wed&#8221;,&#8221;Thu&#8221;,&#8221;Fri&#8221;,&#8221;Sat&#8221;);<br \/>\n       var l = new Array(&#8220;Sunday&#8221;,&#8221;Monday&#8221;,&#8221;Tuesday&#8221;,&#8221;Wednesday&#8221;,&#8221;Thursday&#8221;,&#8221;Friday&#8221;,&#8221;Saturday&#8221;);<br \/>\n       var o = new Array(&#8220;\uc804&#8221;,&#8221;\ud6c4&#8221;);<br \/>\n       var O = new Array(&#8220;\uc624\uc804&#8221;,&#8221;\uc624\ud6c4&#8221;);<br \/>\n       var a = new Array(&#8220;am&#8221;,&#8221;pm&#8221;);<br \/>\n       var A = new Array(&#8220;AM&#8221;,&#8221;PM&#8221;);<\/p>\n<p>       var org_year = arg_date.getFullYear();<br \/>\n       var org_month = arg_date.getMonth();<br \/>\n       var org_date = arg_date.getDate();<br \/>\n       var org_wday = arg_date.getDay();<br \/>\n       var org_hour = arg_date.getHours();<br \/>\n       var org_minute = arg_date.getMinutes();<br \/>\n       var org_second = arg_date.getSeconds();<br \/>\n       var hour = org_hour % 12; hour = (hour) ? hour : 12;<br \/>\n       var ampm = Math.floor(org_hour \/ 12);<\/p>\n<p>       var value = new Array();<br \/>\n       value[&#8220;Y&#8221;] = org_year;<br \/>\n       value[&#8220;y&#8221;] = String(org_year).substr(2,2);<br \/>\n       value[&#8220;m&#8221;] = String(org_month+1).replace(\/^([0-9])$\/,&#8221;0$1&#8243;);<br \/>\n       value[&#8220;n&#8221;] = org_month+1;<br \/>\n       value[&#8220;d&#8221;] = String(org_date).replace(\/^([0-9])$\/,&#8221;0$1&#8243;);<br \/>\n       value[&#8220;j&#8221;] = org_date;<br \/>\n       value[&#8220;w&#8221;] = org_wday;<br \/>\n       value[&#8220;H&#8221;] = String(org_hour).replace(\/^([0-9])$\/,&#8221;0$1&#8243;);<br \/>\n       value[&#8220;G&#8221;] = org_hour;<br \/>\n       value[&#8220;h&#8221;] = String(hour).replace(\/^([0-9])$\/,&#8221;0$1&#8243;);<br \/>\n       value[&#8220;g&#8221;] = hour;<br \/>\n       value[&#8220;i&#8221;] = String(org_minute).replace(\/^([0-9])$\/,&#8221;0$1&#8243;);<br \/>\n       value[&#8220;s&#8221;] = String(org_second).replace(\/^([0-9])$\/,&#8221;0$1&#8243;);<br \/>\n       value[&#8220;t&#8221;] = (new Date(org_year, org_month+1, 1) &#8211; new Date(org_year, org_month, 1)) \/ 86400000;<br \/>\n       value[&#8220;z&#8221;] = (new Date(org_year, org_month, org_date) &#8211; new Date(org_year, 0, 1)) \/ 86400000;<br \/>\n       value[&#8220;L&#8221;] = ((new Date(org_year, 2, 1) &#8211; new Date(org_year, 1, 1)) \/ 86400000) &#8211; 28;<br \/>\n       value[&#8220;M&#8221;] = M[org_month];<br \/>\n       value[&#8220;F&#8221;] = F[org_month];<br \/>\n       value[&#8220;K&#8221;] = K[org_wday];<br \/>\n       value[&#8220;k&#8221;] = k[org_wday];<br \/>\n       value[&#8220;D&#8221;] = D[org_wday];<br \/>\n       value[&#8220;l&#8221;] = l[org_wday];<br \/>\n       value[&#8220;o&#8221;] = o[ampm];<br \/>\n       value[&#8220;O&#8221;] = O[ampm];<br \/>\n       value[&#8220;a&#8221;] = a[ampm];<br \/>\n       value[&#8220;A&#8221;] = A[ampm];<\/p>\n<p>       var str = &#8220;&#8221;;<br \/>\n       var tag = 0;<br \/>\n       for(i=0;i<arg_format.length;i++) {<br \/>\n              var chr = arg_format.charAt(i);<br \/>\n              switch(chr) {<br \/>\n                     case &#8220;<\" : tag++; break;<br \/>\n                     case &#8220;>&#8221; : tag&#8211;; break;<br \/>\n              }<br \/>\n              if(tag || value[chr]==null) str += chr; else str += value[chr];<br \/>\n       }<\/p>\n<p>       return str;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uae00\uc4f4\uc774:\ubd81\uadf9\uacf0 \uc774\ubc88\uc5d0 \uc88b\uc544\uc9c4 \uc810\uc774\ub77c\uba74 \ucd9c\ub825\ud615\uc2dd\uc5d0 html \ud0dc\uadf8\ub97c \ub123\uc744 \uc218 \uc788\uac8c \ub418\uc5c8\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4. < \uc640 > \uc0ac\uc774\uc5d0 \uc788\ub294 \uac83\ub4e4\uc740 \ubaa8\ub450 \ubcc0\ud658\ud558\uc9c0 \uc54a\ub3c4\ub85d \ud588\uac70\ub4e0\uc694. \uc9dd\uc774 \uc548\ub9de\uc73c\uba74 \uace4\ub780\ud558\ub2c8\uae50 \uc870\uc2ec\ud558\uc2dc\uad6c\uc694 ^^; \ud0dc\uadf8 \ubc14\uae65\uc5d0\uc11c\ub294 \ud574\ub2f9\ud558\ub294 \uc601\ubb38\uc790\ub9cc \ubcc0\ud658\ud558\ubbc0\ub85c \uc815\ud655\uc131\ub3c4 \ub192\ud614\uc2b5\ub2c8\ub2e4. \/\/ \ub0a0\uc9dc,\uc2dc\uac04 format \ud568\uc218 = php\uc758 date() function date(arg_format, arg_date) { if(!arg_date) arg_date = new Date(); var M = new Array(&#8220;Jan&#8221;,&#8221;Feb&#8221;,&#8221;Mar&#8221;,&#8221;Apr&#8221;,&#8221;May&#8221;,&#8221;Jun&#8221;,&#8221;Jul&#8221;,&#8221;Aug&#8221;,&#8221;Sep&#8221;,&#8221;Oct&#8221;,&#8221;Nov&#8221;,&#8221;Dec&#8221;); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-564","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=564"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/564\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}