Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Open Graph date format

When generating a meta tag for article:published_time or og:updated_time, in what format should I put the time. Some documentation in Facebook says it should be in Unix epoch and other documentation suggest is should be in ISO 8601.

<meta property="og:updated_time" content="1414056907" /> or

<meta property="og:updated_time" content="2013-01-22T09:10:08+0100" />

Thank you for looking in to this.

Sander

like image 835
Sander Hartveld Avatar asked Oct 23 '14 09:10

Sander Hartveld


2 Answers

I recommend using the ISO 8601 date format as specified in OpenGraph official documentation (see here : http://ogp.me/#data_types).

I tested it successfully with the facebook sharer function to force the crawler to get a new image.

like image 92
Yann Avatar answered Oct 20 '22 03:10

Yann


While I agree with the logic of the last answer, when using the tool at https://developers.facebook.com/tools/debug/og/object/ we see that a meta tag reading

<meta property="og:updated_time" content="2015-04-07T13:19:06-04:00" />

is converted to 1428432011 when FaceBook reads it.

That is not to say, use the integer value. However, if Facebook is the reason you are wondering, it seems not to matter.

like image 41
NappingRabbit Avatar answered Oct 20 '22 03:10

NappingRabbit