datetime - PHP change the date to Y-m-d H:i -


this question has answer here:

what require

how can convert 2013-07-26t10:00:00.000+05:30 y-m-d h:i:s format.

i need 2013-07-26 10:00:00 this.

.

what tried

 $datetime = datetime::createfromformat(datetime::iso8601,2013-07-26t10:00:00.000+05:30);  echo $datetime->format('y-m-d h:i:s'); 

and

 $datetime = datetime::createfromformat(datetime::iso8601, srtotime(2013-07-26t10:00:00.000+05:30));  echo $datetime->format('y-m-d h:i:s'); 

note: the date obtained google calendar's event start , end date.

use datetime

$date = new datetime('2013-07-26t10:00:00.000+05:30'); echo $date->format('y-m-d h:i:s'); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -