I am currently importing external data from a third party API using Scheduler. Everything works great, but the third party API provides dates in the following format:
"Date": "\/Date(1320224444000+0000)\/",
What format is this?
How would I convert this to the standard MYSQL date/time using Laravel 5?
As for the format, I'm assuming some form of unix timestamp as 1320224444000 milliseconds in years is almost 42 years (41.86 to be exact). From the epoch (January 1st 1970), this would be around the end of 2011/ beginning of 2012.
Running the 13 digit (unix time) through this online parser](http://www.onlineconversion.com/unix_time.htm) produces Wed, 02 Nov 2011 09:00:44 GMT making the above guess of late 2011 correct ;)
@mstnorris This doesn't work Carbon::parse('1320224444000+0000'), it will throw an exception
DateTime::__construct(): Failed to parse time string (1320224444000+0000) at position 11 (0): Unexpected character
@SeriousJelly If you want to parse it, you can do something like this
// I know it's not the best way, but you get the correct result ;)
$value = "\/Date(1320224444000+0000)\/";
// We only want the this part of the string 132022444
// So we get the start position + 1
$timestamp = substr($value, strpos($value, '(') + 1, 11);
dd(Carbon::parse($timestamp));