|
Posted by Rob Wilkerson on 11/24/07 20:44
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
Navigation:
[Reply to this message]
|