By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

Date Conversion

P: 8
Hi guys, i need a help. i have to convert the date format.the date can be inserted in any format like dd:mm:yy. i have to convert the format into yyyy-mm-dd.
plz reply
Feb 13 '07 #1
Share this Question
Share on Google+
1 Reply


P: 46
Hi guys, i need a help. i have to convert the date format.the date can be inserted in any format like dd:mm:yy. i have to convert the format into yyyy-mm-dd.
plz reply
Hi,
Your problem would solved by following code
[PHP]$vDate = "DD:MM:YYYY";
$DateValues = explode(":",$vDate);
echo date("Y-m-d",mktime(0,0,0,$DateValues[1],$DateValues[0],$DateValues[2])); [/PHP]
Feb 13 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.