1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 datetime format that is not ISO 8601

Discussion in 'XenForo Questions and Support' started by Brett Peters, Oct 30, 2011.

  1. Brett Peters

    Brett Peters Well-Known Member

    I have been adding some rich snippets to XF and whilst using the rich snippet testing tool I get a warning that the datetime format that is not ISO 8601.

    I should probably mention that I am using {xen:datetime $thread.post_date, html} for the date input just incase I am doing something that is incorrect.

    Is ISO 8601 something that should be addressed or is it just not that important and it would be safe to ignore the error ?
     
  2. Mike

    Mike XenForo Developer Staff Member

    If you need the date in a specific format, you should specify that in the second parameter (a la PHP date()).
     
    Brett Peters likes this.
  3. Stuart Wright

    Stuart Wright Well-Known Member

    Could you give an example, please?
    I'm putting rich snippets into a template.
    It needs to look like
    HTML:
    <meta itemprop="uploadDate" content="2015-02-05T08:00:00+08:00"/>
    
    and the variable I have is $block.publish_date.
    I tried
    Code:
    <meta itemprop="uploadDate" content="{xen:datetime $block.video_title, 'c'}"/>
    and
    Code:
    <meta itemprop="uploadDate" content="{xen:datetime $block.video_title, c}"/>
    But got an error
    DateTime::setTimestamp() expects parameter 1 to be long, string given in /home/sites/avforums/public_html/library/XenForo/Locale.php, line 162
    Thanks
     
  4. Mike

    Mike XenForo Developer Staff Member

    You may need to use {xen:date ...} instead.
     
  5. Stuart Wright

    Stuart Wright Well-Known Member

    No, that doesn't work, either. The value of {xen:date $block.publish_date, 'c'} is 'c'
     
    Last edited: May 31, 2015

Share This Page