php strftime 的問題

來源:互聯網
上載者:User
?今天在使用slimstat的時候發現,當在fitler中選擇某一天當情況下,??Summary的title就變成了“compare with%s”,應該出現的2個日期全部見了。

還以為是slimstat的bug。debug了一下發現,應該傳遞的參數都正常。只是返回的格式化日期為空白。slimstat格式化日期的方法為:????????gmstrftime("%a %e %b %Y", gmmktime(12, 0, 0, $mo, $dy, $yr));debug這個方法才知道,只要有%e這個參數,gmstrftime就返回了Null 字元串。查看了php manual看到下面那段話,

Not all conversion specifiers may be supported by your C library, in which case they will not be supported by PHP's strftime(). Additionally, not all platforms support negative timestamps, so your date range may be limited to no earlier than the Unix epoch. This means that %e, %T, %R and, %D (and possibly others) - as well as dates prior to Jan 1, 1970 - will not work on Windows, some Linux distributions, and a few other operating systems. For Windows systems, a complete overview of supported conversion specifiers can be found at » MSDN

看樣子php manual還是需要好好的研究研究。

?

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.