getCollectionDatePublic - RFC 3339 formatting required
Permalink
I am writing a data feed using the page list functionality, and I need to change the format the Date time of the getCollectionDatePublic value to:
eg: 2000-01-01T00:00:00Z
i.e. Adding a 'T' after the date, and a 'Z' after the time. This is to adhere to RFC 3339 date/time formatting (http://tools.ietf.org/html/rfc3339).
Can anyone point me in the best direction? I'm presuming I'll need a custom date-time helper here, but I'm unsure as to the correct syntax I'll need to use.
Any advice would be great!
Thanks.
eg: 2000-01-01T00:00:00Z
i.e. Adding a 'T' after the date, and a 'Z' after the time. This is to adhere to RFC 3339 date/time formatting (http://tools.ietf.org/html/rfc3339).
Can anyone point me in the best direction? I'm presuming I'll need a custom date-time helper here, but I'm unsure as to the correct syntax I'll need to use.
Any advice would be great!
Thanks.
![beebs93](/files/avatars/50655.jpg)
I had to deal with RFC3339 time formats recently and made an override date helper - hope this helps:
Viewing 15 lines of 42 lines. View entire code block.
Hi beebs93 - This is great, thanks...
Actually I didn't end up having to use a custom/overide helper for my requirements in this case - but your code example did help with getting the formatting I required for outputting the datetime.
Either way - this was really useful - Nice one, cheers!
Actually I didn't end up having to use a custom/overide helper for my requirements in this case - but your code example did help with getting the formatting I required for outputting the datetime.
<?=htmlspecialchars($p->getCollectionDatePublic("Y-m-d\TH:i:s\Z"));?>
Either way - this was really useful - Nice one, cheers!