getCollectionDatePublic - RFC 3339 formatting required

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 (

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!


View Replies: View Best Answer
beebs93 replied on at Permalink Best Answer Reply
I had to deal with RFC3339 time formats recently and made an override date helper - hope this helps:

defined('C5_EXECUTE') or die('Access Denied.');
class DateHelper extends Concrete5_Helper_Date{
    * Converts a numerical timestamp to a RFC3339 timestamp
    * @see
    * @param integer $intTs - A numerical timestamp
    * @return string
    * @author Brad Beebe
    * @since March 8, 2013
   public function timestampToRFC3339($intTs){
      $strDate = date('Y-m-d\TH:i:s', $intTs);
drbiskit replied on at Permalink Reply
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!