{"id":812,"date":"2012-06-02T22:23:03","date_gmt":"2012-06-02T14:23:03","guid":{"rendered":"http:\/\/www.poloo.org\/?p=812"},"modified":"2012-06-02T22:25:45","modified_gmt":"2012-06-02T14:25:45","slug":"%e6%9d%a5%e8%87%aa%e6%9b%b4%e5%8f%8b%e5%a5%bd%e7%9a%84%e6%97%b6%e9%97%b4%e6%a0%bc%e5%bc%8f%e5%a6%82%e2%80%9c3%e5%88%86%e9%92%9f%e5%89%8d%e2%80%9d%e3%80%90%e8%85%be%e8%ae%af%e5%be%ae%e5%8d%9aiweibo2-0","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=812","title":{"rendered":"\u6765\u81ea\u66f4\u53cb\u597d\u7684\u65f6\u95f4\u683c\u5f0f\u5982\u201c3\u5206\u949f\u524d\u201d\u3010\u817e\u8baf\u5fae\u535aiweibo2.0\u3011"},"content":{"rendered":"<pre class=\"brush:php\">\/**\r\n * timestamp\u8f6c\u6362\u6210\u663e\u793a\u65f6\u95f4\u683c\u5f0f\r\n * @param $timestamp\r\n * @return unknown_type\r\n *\/\r\nfunction tTimeFormat($timestamp)\r\n{\r\n  $curTime = time();\r\n  $space = $curTime - $timestamp;\r\n \/\/1\u5206\u949f\r\n if($space &lt; 60)\r\n  {\r\n   $string = \"\u521a\u521a\";\r\n   return $string;\r\n }\r\n elseif($space &lt; 3600) \/\/\u4e00\u5c0f\u65f6\u524d\r\n {\r\n   $string = floor($space \/ 60) . \"\u5206\u949f\u524d\";\r\n   return $string;\r\n }\r\n $curtimeArray = getdate($curTime);\r\n  $timeArray = getDate($timestamp);\r\n if($curtimeArray['year'] == $timeArray['year'])\r\n {\r\n   if($curtimeArray['yday'] == $timeArray['yday'])\r\n   {\r\n     $format = \"%H:%M\";\r\n      $string = strftime($format, $timestamp);\r\n      return \"\u4eca\u5929 {$string}\";\r\n    }\r\n   elseif(($curtimeArray['yday'] - 1) == $timeArray['yday'])\r\n   {\r\n     $format = \"%H:%M\";\r\n      $string = strftime($format, $timestamp);\r\n      return \"\u6628\u5929 {$string}\";\r\n    }\r\n   else\r\n    {\r\n     $string = sprintf(\"%d\u6708%d\u65e5 %02d:%02d\", $timeArray['mon'], $timeArray['mday'], $timeArray['hours'], \r\n      $timeArray['minutes']);\r\n     return $string;\r\n   }\r\n }\r\n $string = sprintf(\"%d\u5e74%d\u6708%d\u65e5 %02d:%02d\", $timeArray['year'], $timeArray['mon'], $timeArray['mday'], \r\n  $timeArray['hours'], $timeArray['minutes']);\r\n  return $string;\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/** * timestamp\u8f6c\u6362\u6210\u663e\u793a\u65f6\u95f4\u683c\u5f0f * @param &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[108,36,109,107],"class_list":["post-812","post","type-post","status-publish","format-standard","hentry","category-Php","tag-function","tag-php-2","tag-109","tag-107"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=812"}],"version-history":[{"count":2,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/812\/revisions"}],"predecessor-version":[{"id":830,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/812\/revisions\/830"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}