I am using the timestamp data type in mysql to keep track of when each row has been modified or inserted.
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
This saves the date in the database in the form of: 2015-11-24 13:55:10
I need to have a timestamp though, that will be used in the meta tags and will be in the following form :
<meta property="article:published_time" content="" />
as advised by opengraph guidelines. Googling a lot, and the following are the two candidates on which i ended up to:
which echoes 2015-11-23T15:27:01+00:00
whch echoes 2015-11-23UTC15:27:01.00
The latter also includes the server timezone.
An alternative to this would be to convert the timestamp, during the query phase, which from what i read is not suggested, and of course did not work for me. Conversion in the php code allows you to use the timestamp with multiple forms in the same page e.g in meta and on footer notifying when this was published and by whom.