You're viewing a single post. I have much more to say! The main blog page is a good starting point.

Dates and times? Anewt!

Several people have been asking about my web project Anewt (Almost No Effort Web Toolkit) after my previous article titled A sneak peek at Anewt.

Well, there’s been a lot of developer activity lately and I have registered the project at Launchpad so that we can start using a bug tracker to track the current open issues and feature requests.

Today, I’ve been busy rewriting the datetime module, which was a total piece of legacy crap that was not useful at all for new applications. It was never used in a real situation and was basically unmaintained for over a year. I opened bug #3528 to get some feedback and started implementing the new module.

Fortunately, most date formatting can be done using simple PHP functions, but since PHP’s function syntax is so inconsistent, a nice API to wrap all these is very nice to have. Any date that can be parsed by the datetime module, can be converted to several formats, which include unix timestamps, ISO 8601 format, RFC 2822 format (used in e-mail and RSS feeds) and of course just the year, month, day, hour, minutes and seconds.

The other part the datetime module takes care of is date parsing. Right now it handles a variety of formats, including unix timestamps, the formats used in SQL and, last but not least, various forms as defined in ISO 8601. A summary of my current implementation can be found in the comments I posted on the bug #3528 page.

Finally, the datetime module provides a is_valid() function that validates any parseable date. This saves you a lot of time checking user input (when processing a form, for instance).

So, Anewt is definitely not dead. It’s getting a lot of love lately and I’m looking forward to releasing a first beta.