View Single Post
Old 10-08-2012, 04:41 AM   PM User | #3
nani_nisha06
Regular Coder

 
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
nani_nisha06 is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
Well, since you don't mention which of these it is all I can give is an example. dd-mm-yyyy is valid in php for a date format: http://ca1.php.net/manual/en/datetime.formats.date.php so you can use it in strtotime or dateTime classes.
PHP Code:
$sDate '02-02-2012';
$dt = new DateTime($sDate);
print 
$dt->format('Y-m-d'); // 2012-02-02 
You'll want to look into database security or prepared statements as well.
Fou-Lu,


Dont mind can you be more specific with example code I have posted .......I am a beginner and trying to understand a lot but it became tuff for me .... so please help me.

In the above code I have created a frontend form for the Creation_Date & Resolved_Date which takes dd-mm-yyyy but when i am posting it should post to database as yyyy-mm-dd..

Regards,
Nani
nani_nisha06 is offline   Reply With Quote