Converting to date in PHP from yyyymmdd format
Use strtotime() to convert a string containing a date into a Unix timestamp: <?php // both lines output 813470400 echo strtotime(“19951012”), “\n”, strtotime(“12 October 1995”); ?> You can pass the result as the second parameter to date() to reformat the date yourself: <?php // prints 1995 Oct 12 echo date(“Y M d”, strtotime(“19951012”)); ?> Note … Read more