Your code works for me.
$input = 201308131830; echo date("YMd H:i:s",strtotime($input)) . "\n"; echo date("D", strtotime($input)) . "\n";
Output:
2013-Aug-13 18:30:00 Tue
However, if you pass 201308131830 as a number, it is 50-100 times larger than a 32-bit integer can represent. [depending on the specific implementation of your system] If your server / PHP version does not support 64-bit integers, the number will overflow and will probably be output as a negative number, and date() will default to Jan 1, 1970 00:00:00 GMT .
Make sure that the source from which you extract this data returns this date as a string, and save it as a string.
source share