Page 1 of 1

PHP 5 Date/Time Class

Posted: Fri Dec 08, 2006 1:48 pm
by seangates
I have been searching everywhere for a good, complete date/time class. Anyone have a great one they use?

Some of the requirements would be:

1. Basic formatting
2. Functions for differences in dates
3. Being able to tell first days of months, quarters, years, etc.
4. GMT translation and daylight savings, etc.

Thanks!
Sean

Posted: Fri Dec 08, 2006 2:09 pm
by feyd
Have you looked at the built-in one?

Posted: Fri Dec 08, 2006 2:23 pm
by seangates
feyd wrote:Have you looked at the built-in one?
I believe you are implying that I can use PEAR or something, right?

Posted: Fri Dec 08, 2006 2:27 pm
by Luke
Actually I think he means these: http://us2.php.net/manual/en/ref.datetime.php

Posted: Fri Dec 08, 2006 2:45 pm
by feyd
No, there's a datetime class in PHP itself.

date_create()

It's available in newer builds, but it could be worth looking at.

Posted: Fri Dec 08, 2006 2:49 pm
by seangates
Awesome. I have PHP 5.1.6, so this would work great.

Thanks!
Sean

Posted: Fri Dec 08, 2006 3:01 pm
by Luke
feyd wrote:No, there's a datetime class in PHP itself.
Oh... very cool! I didn't know that. :)

Posted: Fri Dec 08, 2006 3:02 pm
by RobertGonzalez
I can honetly say that I had never seen that object before. It is nice to know that it is there. Thanks feyd.