I have a form where the date is displayed in UK format. When the date is submitted from the website and emailed to me I would like the date to be converted back so that it is a m/d/y format. Any ideas would be appreciated. Please let me know if you need more information. Thanks!
But how? My header sends information to thank you page as well as sends an email with the information contained in the form
If I might make a suggestion -- I'd suggest "j F Y" or "j M Y" -- you never have to mess with the order and it leaves zero confusion. Far, far easier than leaving them all numbers and constantly swapping back and forth to simply say "1 September 2012" or "1 Sep 2012" -- oh noes, it's a few more characters, not that. When it comes to European format vs. US format, turns it into a non-issue. Which of course, is why most western militaries uses "j F Y" on all official documents.
I don't think I properly explained myself, I apologize. The date is selected by the user, for example they may be submitting for a class on 24/9/2012. That is the date I need to format back to US, so when it is submitted into our db it matches up with the class date of 9/24/2012. Does that make sense? Thanks!
Here: http://php.net/manual/en/function.strtotime.php Convert to timestamp and then use date() to convert to what you need. http://php.net/manual/en/function.date.php Or split by / and put day, month, yar into it's own variable and then combine the way you want it. $7 an I will code it for you
If you can share the source code then it would be easier for me to say something about this and also i learn something.