Click here to Skip to main content
15,914,444 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi!

I want to validate the date inputted. If the date is in this format 11/24/2014 it is okay. But if the format is 11/24/2014 0:00 it should return false.

Here is the code:
PHP
//<-- I hope to write the validation here.
//Edit format of excel date to sql date.
$date = explode("/", addslashes($data[16]));
$datePurchased = $date[2]."-".$date[0]."-".$date[1]." 00:00:00";

Thank you and God bless.
Posted
Comments
PIEBALDconsult 4-Dec-14 23:00pm    
Only ISO 8601 formats are acceptable -- YYYY-MM-DD

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900