-2

Actual Format 2015-12-16T00:00:00Z

i need like

Result Format: 2015-12-16 00:00:00

i tried this code $cc=str_replace("T",'',2015-12-16T00:00:00Z);

Balu
  • 23
  • 9

1 Answers1

1

Using str_replace:

$cc = str_replace('Z', '', str_replace('T', ' ', '2015-12-16T00:00:00Z'));

OR

using preg_replace:

 $cc = preg_replace(array('/T/', '/Z/'), array(' ', ''), '2015-12-16T00:00:00Z');
Sanjay Kumar N S
  • 4,653
  • 4
  • 23
  • 38