1

Ok I can't work out the correct way to convert this using PHP.

This is the current output format of the Date/Time string looks like this

2014-03-12 14:38:00

I am trying to get it to look like this...

2014-03-12T14:38:38+00:00

What is the correct time conversion for this type?

Matt The Ninja
  • 2,641
  • 4
  • 28
  • 58

1 Answers1

2

Use DateTime objects:

$dateObj = new DateTime('2014-03-12 14:38:00', new DateTimeZone('UTC'));
echo $dateObj->format(DateTime::ISO8601);
Amal Murali
  • 75,622
  • 18
  • 128
  • 150