I'm looking for the date() format that will give me a date like this:
2013-04-09T10:00:00Z
Is there something simpler than just using the format 'Y-m-d ...'?
The date format 'c' (ISO 8601) used with gmdate() (for UTC time) comes very close:
2013-04-09T10:00:00+00:00
You just need to modify it by replacing the trailing +00:00 with Z (for Zulu):
echo substr_replace(gmdate('c'), 'Z', -6);
The alternative is simply this:
echo gmdate('Y-m-d\TH:i:s\Z');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With