-3

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.

cyberlobe
  • 1,783
  • 1
  • 18
  • 30
Biju s
  • 420
  • 1
  • 7
  • 16

1 Answers1

0
$olddate = date('c');
echo date('Y-m-d H:i:s',strtotime($olddate));
  • Thanks, but manual implementation take place change code in lot of place .is common settings available php 5.6 – Biju s Dec 28 '16 at 06:54
  • 1
    you can use it as function so you can change it at one place and effect goes all placed or instead of date('c') you can use date('Y-m-d H:i:s) also –  Dec 28 '16 at 06:58