The date value which is coming from API is "2015-12-16T22:14:26-0700" now i need to convert the date into "2015-12-16 22:14:26" without using DateTime object. To do that i am trying to match the timezone -0700 in the end and trying split the date into "2015-12-16" , "22:14:26" , "-0700" the below code is returning an array. please let me know where i did wrong here.
the same i have to do if the date is coming in
"2015-12-17 07:00:00 Etc/GMT" in this format as well.
preg_match("/.*?([-+]d+)$/", "2015-12-16T22:14:26-0700", $timeZone);
print_r($timeZone);