2008-11-25 41 views

回答

2

這不是一個URL或任何東西,但你可以得到一個公平的想法使用反射:

Reflection::export(new ReflectionClass('DateTime')); 

Class [ class DateTime ] { 

    - Constants [11] { 
    Constant [ string ATOM ] { Y-m-d\TH:i:sP } 
    Constant [ string COOKIE ] { l, d-M-y H:i:s T } 
    Constant [ string ISO8601 ] { Y-m-d\TH:i:sO } 
    Constant [ string RFC822 ] { D, d M y H:i:s O } 
    Constant [ string RFC850 ] { l, d-M-y H:i:s T } 
    Constant [ string RFC1036 ] { D, d M y H:i:s O } 
    Constant [ string RFC1123 ] { D, d M Y H:i:s O } 
    Constant [ string RFC2822 ] { D, d M Y H:i:s O } 
    Constant [ string RFC3339 ] { Y-m-d\TH:i:sP } 
    Constant [ string RSS ] { D, d M Y H:i:s O } 
    Constant [ string W3C ] { Y-m-d\TH:i:sP } 
    } 

    - Static properties [0] { 
    } 

    - Static methods [0] { 
    } 

    - Properties [0] { 
    } 

    - Methods [9] { 
    Method [ public method __construct ] { 
    } 

    Method [ public method format ] { 
    } 

    Method [ public method modify ] { 
    } 

    Method [ public method getTimezone ] { 
    } 

    Method [ public method setTimezone ] { 
    } 

    Method [ public method getOffset ] { 
    } 

    Method [ public method setTime ] { 
    } 

    Method [ public method setDate ] { 
    } 

    Method [ public method setISODate ] { 
    } 
    } 
} 

不完美的,因爲沒有爭論,但一個起點,至少。他們應該讓這個更容易發現,我同意!

+0

那是我特別感興趣的構造函數,反射不給。我是新來的反射類,並可能使用它一段時間(我不知道它是否很容易在PHP文檔中找到?) – user10117 2008-11-25 07:17:08

+0

:) http://au.php.net/oop5。反射 如果它特別是構造函數,這可能有所幫助: <?php date_default_timezone_set('Europe/London'); $ datetime = new DateTime('2008-08-03 14:52:10'); echo $ datetime-> format(DATE_ATOM); ?> (來自date_create()手冊頁)。 – majelbstoat 2008-11-25 08:16:43

0

這些東西記錄在文檔中 - 也許不是你要求它的時間。

總之,通過擴展的作者,你可以有一個讀得到完整的細節:http://derickrethans.nl/phparchitects-guide-to-date-and-time-programming.html

下一頁到德里克Rethans的是在這裏和那裏發表演講關於主題和幻燈片可供選擇。如果你有機會參加一個會議並聽他的一次會談,就去做吧。

最近的一個:

FrOsCon,2010 8月22日:XXXX://derickrethans.nl/talks/time-froscon10.pdf(來源:XXXX://derickrethans.nl/talks.html)