XF 1.1 datetime format that is not ISO 8601

Brett Peters

Well-known member
#1
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 ?
 

Stuart Wright

Well-known member
#3
If you need the date in a specific format, you should specify that in the second parameter (a la PHP date()).
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
 
#6
Hey,
I also need that value and tried many things:
{xen:date $thread.post_date, c} returns c
and
{xen:datetime $thread.post_date, c}returns 6. Juli 2017 um 18:19 Uhr

Does anybody got a solution? :S
 
Top