Jump to content

Archived

This topic is now archived and is closed to further replies.

glenelkins

change date format from inputted date

Recommended Posts

Hi

Ok i use an open source popup calendar to input the date into a text box, it uses the format mm/dd/yyyy
I would like to convert this to mm-dd-yyyy so its accepted in the database, cant remember how to do this can anyone help quickly plz

Share this post


Link to post
Share on other sites
yeh and as the database takes yyyy-mm-dd (sorry i typed it wrong last time) i need to convert from DD-MM-YYYY

sorry i put the wrong formats completely before

Share this post


Link to post
Share on other sites
[code]list($d,$m,$y) = explode("-",$old_date);
$new_date = date("Y-m-d",mktime(0,0,0,$m,$d,$y));[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.