Sounds easy, but I can't find where this built in class and others exists in the documentation. I use functions but want to know what there is on the OO side.
views:
217answers:
7It's not a URL or anything, 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 a starting point at least. They should make this easier to find out, I agree!
There is a list of new classes in PHP 5.2.0 here:
http://www.php.net/manual/en/migration52.classes.php
..which links to the new DateTime class info here:
The URL you mentioned http://www.php.net/manual/en/migration52.classes.php doens't describe the class at all. Surely there is somewhere where this and other classes are documented.
A description can be found in the comments of the documentation :
http://php.net/manual/fr/book.datetime.php#84699
EDIT : This morning I found something interresting :
http://laughingmeme.org/2007/02/27/looking-at-php5s-datetime-and-datetimezone/
The DateTime class documentation can be found at php.net/DateTime , this has information on both the class and functions, or just the class documentation is available at php.net/manual/en/class.datetime.php
The stuff is documented in documentation - maybe not that time you asked for it.
Anyway, by the author of the extension, you can have a read to get the full details: http://derickrethans.nl/phparchitects-guide-to-date-and-time-programming.html
Next to that Derick Rethans is giving talks here and there about the subject and slides are available. If you have the chance to visit a conference and listen to one of his talks, just do it.
A recent one:
FrOsCon, 22 Aug 2010: xxxx://derickrethans.nl/talks/time-froscon10.pdf (Source: xxxx://derickrethans.nl/talks.html)