News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen's Blog:
Validating dates
November 09, 2010 @ 12:11:12

In a new Zend Framework related post to his blog today Rob Allen takes a look at a different operating mode he found with Zend_Date changing how it handles format specifiers.

I discovered recently that Zend Framework 1's Zend_Date has two operating modes when it comes to format specifiers: iso and php, where iso is the default. When using Zend_Validate_Date in forms, I like to use the php format specifiers as they are what I'm used to and so can easily know what they mean when reviewing code that I wrote months ago.

His example code shows how you can use the standard date formatting strings in a Zend_Form validator (the "php" format) and an example using the Zend_Date::MONTH or Zend_Date::YEAR identifiers (the "iso" format). He also shows how he met two other requirements - validation for empty and a consistent format on the date validation ("Y-m-d").

0 comments voice your opinion now!
validate date zendform zendframework iso format


blog comments powered by Disqus

Similar Posts

Jani Hartikainen's Blog: Zend_Acl part 1: Misconceptions and simple ACLs

Michelangelo van Dam: Learning lessons at ZendUncon

Logan Buesching's Blog: Zend_Pdf_Cell

Zend: Zend Framework Database Access Webinar (Oct 31st, 2007)

Michelangelo van Dam's Blog: Unit testing after Zend Framework 1.8 webinar


Community Events

Don't see your event here?
Let us know!


voicesoftheelephpant version interview example php7 api conference framework laravel library symfony2 performance introduction community release podcast opinion series extension xdebug

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework