RE: [PHP] Check if var has a date (timestamp or regular)
| From: | Sanjeev N | Date: | Wed, 08 Aug 2007 11:20:39 +0000 |
| Subject: | RE: [PHP] Check if var has a date (timestamp or regular) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260435@lists.php.net to get a copy of this message | ||
Hi,
You need to check with your submitted data as in which format it is. Try
with different combination for splitting the string (include -, / while
splitting string). If input string works with split then assume input string
as in above format. Otherwise simple, consider it as in timestamp.
But I suggest if some user is entering the date then let them insert the
date as you want. Just mention (mm/dd/yyyy) after the text field and it will
solve your problem
Warm Regards,
Sanjeev
http://www.sanchanworld.com/
http://webdirectory.sanchanworld.com
-----Original Message-----
From: OOzy Pal [mailto:oozypal@gmail.com]
Sent: Monday, August 06, 2007 5:22 PM
To: PHP
Subject: [PHP] Check if var has a date (timestamp or regular)
How can I check an inputed date if it is a valid date and if it is in
the form of a timestamp or regular date such as (22-07-2007 or
22/07/2007)
--
OOzy
Ubuntu-Feisty
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php