crag Posted March 21, 2006 Share Posted March 21, 2006 I have a number of forms on my site that the user will have to enter a date but they have to enter this using the format YYYY-MM-DD. As im from the uk I would like them to enter the date in the format DD-MM-YY.I am using the date_format() function when I output the date to screen but I need a way to format the date before the user has to enter it into the form.Is there an in built mysql date column type that will do this or will I have to this using my own php script? Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 22, 2006 Share Posted March 22, 2006 Try using date().[code]echo date("d-m-y");[/code]If you need it to display a specific date, use the mktime or strtotime functions.[a href=\"http://www.php.net/date\" target=\"_blank\"]http://www.php.net/date[/a][a href=\"http://www.php.net/mktime\" target=\"_blank\"]http://www.php.net/mktime[/a][a href=\"http://www.php.net/strtotime\" target=\"_blank\"]http://www.php.net/strtotime[/a] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.