If you can, you might have to change the string format first to something like:
strtotime(‘0000-00-00 00:00:00’)
because it’s not a valid format by default.
I have tried a couple ways to convert the date in php but I cant get them to work is there a php function that would convert the format I have of -4, 2012, 8 – 1, 15, 00, 00, 00 to a date useable in strtotime(‘0000-00-00 00:00:00’) of is there a way to explode the current value and recreate the date using the exploded array values.
As I know, there isn’t, at least not the format you’ve provided. That looks like a custom format to me.
If your string uses that exact format, then you just have to explode it using
http://php.net/manual/en/function.explode.php
then rejoin the array elements into a string… for example:
$dateItems = explode(",", "-4, 2012, 8 - 1, 15, 00, 00, 00");
this will result in
( [0] => -4 [1] => 2012 [2] => 8 – 1 [3] => 15 [4] => 00 [5] => 00 [6] => 00 )
Just join the ones stitching them together as you need, something like:
$dateString = $dateItems[1] . ‘-‘ . $dateItems[2]… and so on.