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? Link to comment https://forums.phpfreaks.com/topic/5448-uk-date-problem/ 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] Link to comment https://forums.phpfreaks.com/topic/5448-uk-date-problem/#findComment-19542 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.