PostGreSQL time format for sitemaps

After converting the database for Adage from a memory resident format backed by cl-store to the postmodern PostGreSQL interface, Google reported that my generated sitemaps were flawed.

PostGreSQL date in Sitemap - Error according to Google

The original bit of SQL I used to fill the last modified field looked something like this
cast(timestamp as text)

Unfortunately, that format did not satisfy the google sitemap parser, so I had to use a format string in the casting SQL statement. This is what I ended up using
to_char(timestamp at time zone 'gmt', 'YYYY-MM-DD\"T\"HH24:MM:SSZ')

Last modified on August 21, 2013. This entry was posted in Uncategorized and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.