date('c') issue in Php 5.6

4.1k views Asked by At

I am using Yii 1.6 Purchased application, hosted in Php 5.6 Server.

I have a issue in date format, software using to save date DB using code date('c'). But this code got date below format :

date('c') =  2016-12-28T06:32:32+00:00

Because above format data is not saving in DB. I want date format as :

2016-12-28 06:32:32 

Manual change is code is not possible, because application use this code lot of place, So i need common settings code to get date('c') as y-m-d h:i:s format in php 5.6.

1

There are 1 answers

2
AudioBubble On
$olddate = date('c');
echo date('Y-m-d H:i:s',strtotime($olddate));