How do you find the description of the DateTime class in the PHP documentation?

Sounds simple, but I can't find where this built-in class and others exist in the documentation. I am using functions but want to know what is on the OO side.

+1


source to share


7 replies


It's not a url or whatever, but you can get a fair idea using Reflection:

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 ] {
    }
  }
}

      



Not perfect as there are no arguments, but at least a starting point. They should make it easier to find out, I agree!

+2


source


http://no2.php.net/date_create

Information about the constructor. Some nice information about serialization in the comments.



http://laughingmeme.org/2007/02/27/ Nice tutorial, maybe old.

http://ditio.net/2008/06/03/php-datetime-and-datetimezone-tutorial/ Another slightly different approach.

+1


source


PHP 5.2.0 provides a list of new classes:

http://www.php.net/manual/en/migration52.classes.php

.., which refers to new information about the DateTime class:

http://www.php.net/manual/en/ref.datetime.php

0


source


The url you mentioned http://www.php.net/manual/en/migration52.classes.php doesn't describe the class at all. Surely somewhere where this and other classes are documented.

0


source


The description can be found in the comments on the documentation:

http://php.net/manual/fr/book.datetime.php#84699

EDIT: I found something interesting this morning:

http://laughingmeme.org/2007/02/27/looking-at-php5s-datetime-and-datetimezone/

0


source


The documentation for the DateTime class can be found at php.net/DateTime , it contains information on both the class and the functions, or just the class documentation can be found at php.net/manual/en/class.datetime.php

0


source


The stuff is documented in the documentation - perhaps not at the time you asked for it.

Anyway, by the author of the extension, you can read to get full details: http://derickrethans.nl/phparchitects-guide-to-date-and-time-programming.html

Alongside what Derick Rethans talks here and there about the subject and the slides. If you have the opportunity to attend a conference and listen to one of his conversations, just do it.

Last:

FrOsCon, 22 Aug 2010: xxxx: //derickrethans.nl/talks/time-froscon10.pdf (Source: xxxx: //derickrethans.nl/talks.html)

0


source







All Articles