PHP 5 Date/Time Class

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
seangates
Forum Newbie
Posts: 3
Joined: Fri Dec 08, 2006 12:10 pm
Location: West Linn, Oregon

PHP 5 Date/Time Class

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Have you looked at the built-in one?
seangates
Forum Newbie
Posts: 3
Joined: Fri Dec 08, 2006 12:10 pm
Location: West Linn, Oregon

Post 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?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Actually I think he means these: http://us2.php.net/manual/en/ref.datetime.php
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
seangates
Forum Newbie
Posts: 3
Joined: Fri Dec 08, 2006 12:10 pm
Location: West Linn, Oregon

Post by seangates »

Awesome. I have PHP 5.1.6, so this would work great.

Thanks!
Sean
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

feyd wrote:No, there's a datetime class in PHP itself.
Oh... very cool! I didn't know that. :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Post Reply