This question already has an answer here:
I need to generate a MessageTime
for a xml based api. In the example request file, they are using the following:
<MessageTime>2001-12-17T09:30:47-05:00</MessageTime>
What is the format of this datetime string? I want to generate it using date()
method or DateTime
class.
This is what I tried so far: I am in the UK, so i am using the offset 00:00
var_dump(date('Y-m-d\TH:i:s').'-00:00')
// Output: 2014-05-26T20:11:45-00:00
Is this correct?
</div>