Forum Moderators: coopster
PHP 6 will be shipping a new inbuilt date and timestamp manipulation API. It's available on PECL here:
[pecl.php.net...]
I pulled the package down just to check a couple things out. Seems like it is going to be a nice set of functions. Granted, for any of us that have been doing development in PHP for any given period of time we probably all have our own classes or functions that we've built, but now it's going to be built-in (starting at PHP6 at least, by the looks of it).
Here are a couple of comment notes from the code:
Date is a collection of functions and classes to deal with dates.
Support for date outside the UNIX date limitations. It provides
a lot of convenience functions/methods.DATES RANGE SUPPORT
-------------------Year 1 to around 32000. Sorry to do not be too much precise for now :).
To be honest it works with years before year 1, but a bit too hasardous imo.
I may add it year<0 in next versions.EASTER DATES
------------<date_get_easter> use the ecclesiastical calendar. If you like to get the
orthodox ecclesiastical calendar, use date_get_orthodox_easter.informations about easter dates calculation:
[smart.net...]
[smart.net...]WEEK NUMBERS
------------Take care about the different weeknumbers function.
get_week_year (Date:getWeekOfYear) returns the "human" week of year
get_isoweek_of_year returns the ISO8601 week of yearAlgorithm for the ISO8601 described here:
[personal.ecu.edu...]
I noticed the TODO list also includes a request to add a Calendar class. Altogether, it looks like a nice feature set to be built-in.
That's usually how the best stuff gets back in when you're dealing with open source, though. Contributions from programmers that are using the software and offer their time and effort for enhancements like this. Some of the stuff looks quite promising in this one.
By the way, welcome to WebmasterWorld, lupatis.
Some previous implementations of this functionality have been buggy.
This time, 2006-01-01 corresponds to 2005-W52-D7 for example.
It follows that 2006-W01-D1 is therefore on 2006-01-02.