You are here: Re: Options for Validating a Date Value? « PHP Programming Language « IT news, forums, messages
Re: Options for Validating a Date Value?

Posted by Jerry Stuckle on 11/24/07 20:56

Rob Wilkerson wrote:
> Surprisingly (at least to me), there doesn't seem to be a built-in
> function to validate a date value (like, say, is_date()). Given that,
> is there a best practice for determining whether a value is a valid
> date/time? The values I need to test will likely be unix timestamp
> values and I need to be able to distinguish them as date/time values
> from other integer/numeric values.
>
> What I'm trying to do is use reflection to iterate over the properties
> of an object and insert them into database fields based on their type
> (integers in an INT field, strings in a VARCHAR field, date/time
> values in a DATETIME field). Most are fairly straightforward, but I'm
> not sure how to consistently and accurately identify a datetime value.
>
> Any thoughts would be appreciated.
>
> Rob
>

Unix timestamps are just integers. You can't differentiate them.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация