{"id":1607,"date":"2019-10-04T00:51:34","date_gmt":"2019-10-03T15:51:34","guid":{"rendered":"http:\/\/wp.ultimai.org\/wp\/?p=1607"},"modified":"2020-10-07T08:21:16","modified_gmt":"2020-10-06T23:21:16","slug":"post-1607","status":"publish","type":"post","link":"https:\/\/wp.ultimai.org\/?p=1607","title":{"rendered":"Oct 1-12 ,Fri 12:22 \u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u6e08\u307f\u306e\u65e5\u4ed8\u3092\u65e5\u4ed8\u578b\u306b\u9006\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3059\u308b\u3084\u3064"},"content":{"rendered":"\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"><code> \r\ndate_default_timezone_set('America\/Los_Angeles');\r\n\/\/ \u8a08\u7b97\u3059\u308b\u306e\u3067\u73fe\u5730\u306e\u6642\u9593\u3067\u3084\u308b\r\n$usweek = ['Sunday'=&gt;0,'Monday'=&gt;1,'Tuesday'=&gt;2,'Wednesday'=&gt;3,'Thursday'=&gt;4,'Friday'=&gt;5,'Saturday'=&gt;6];\r\n$usmonth = ['Jan'=&gt;1,'Feb'=&gt;2,'Mar'=&gt;3,'Apr'=&gt;4,'May'=&gt;5,'June'=&gt;6,'July'=&gt;7,'Augt'=&gt;8,'Sept'=&gt;9,'Oct'=&gt;10,'Nov'=&gt;11,'Dec'=&gt;12,];\r\n\r\n$ending = 'Friday at 11:21PM PDT';  \/\/  \u5165\u529b\u4f8b1\r\n$ending = 'Oct 12 at 5:14PM PDT';   \/\/      2\r\n$ending = 'Today at 11:57PM PDT';   \/\/      3\r\n\r\n$endings = explode(\" \", $ending);\r\n$now = new DateTime();\r\n\r\nif( array_key_exists( $endings[0] ,$usweek )){\r\n  \/\/ \u66dc\u65e5\u304b\u3089\u59cb\u307e\u3063\u3066\u308b\r\n    $apm = substr($endings[2], -2);\r\n    $hmt = str_replace($apm ,'' , $endings[2]);\r\n    $w = date('w', $now-&gt;getTimestamp());  \/\/\u4eca\u65e5\u306e\u66dc\u65e5  4 \r\n    $deff = $usweek[$endings[0]] - $w;    \/\/1 \u65e5\u5f8c\r\n    echo date(\"Y-m-d\",strtotime(\"+$deff day\")),\" \" , date('H:i',strtotime($endings[2])),\"\r\n\";   \/\/17:21 ok\r\n\r\n}elseif(array_key_exists( $endings[0] ,$usmonth )){\r\n    $endday = $usmonth[$endings[0]].'-'. $endings[1].' '. date('H:i',strtotime( $endings[3]));\r\n    if(date(\"m-d H:i\") &lt; $endday){\r\n      echo date(\"Y\") .'-'.$endday;\r\n    }else{ \r\n      echo date(\"Y\",strtotime(\"+1 year\")).'-'.$endday;\r\n    }\r\n}elseif( $endings[0] == 'Today'){\r\n    echo date(\"Y-m-d\").\" \" . date('H:i',strtotime($endings[2])) ;\r\n}\r\n\r\n <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>date_default_timezone_set [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1607","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts\/1607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1607"}],"version-history":[{"count":4,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts\/1607\/revisions"}],"predecessor-version":[{"id":1802,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=\/wp\/v2\/posts\/1607\/revisions\/1802"}],"wp:attachment":[{"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.ultimai.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}