I get this date format from facebook and google docs:
2011-02-25T10:55:25+0000
How can I convert it to something like
25/02/2011 10:55:25
Use strtotime to get the timestamp.
$ts = strtotime('2011-02-25T10:55:25+0000'); echo date('d/m/YH:i:s', $ts);
<?php $date = new DateTime('2011-02-25T10:55:25+0000'); print $date->format('d/m/YH:i:s'); ?>
Remember to set the correct time zone in this example. See the datetime documentation on php.net for more details.
It looks like SOAP .
Try reading it with a DateTime class and displaying it in native format.
See ZeSimon answer for code.
$ out = preg_replace ("/ ^ ([0-9] +) - ([0-9] +) - ([0-9] +) T ([0-9] +: [0-9] +: [0-9] +) \ + ([0-9] +) / "," \ $ 3 / \ $ 2 / \ $ 1 \ $ 4 ", $ in);
Source: https://habr.com/ru/post/1341660/More articles:Is it possible to extend AR relationships? - activerecordquestion mark inside C # syntax - c #How to select a set of unique random numbers (without duplicates) using the jQuery.inArray method? - javascriptwhat is this strange syntax in C # bytes * - pointersRails - Indexing a Sunspot Conditional Model - ruby-on-railsBourne shell version - shGood behavior for energetically loading a few siblings and grandchildren (cousins?) NHibernate 3.0 Linq - performanceEntity Framework - View or attach a database in Linq to objects - c #What can cause damage to my WP7 application only on some models? - windows-phone-7Escape function for regular expressions or LIKE patterns - regexAll Articles