Why Symphony store dates on a varchar field type and not datetime? What are pros and cons?

Sorry for dumb question.

Hmm, It stores 3 things. Two timestamps and a string representation. The problem we faced was the datetime field is fairly restrictive, and wouldn’t retain the timezone/offset information. The date stored by Symphony is of ISO 8610 format (added in PHP5). It looks like 2009-07-27T15:05:00+10:00. A datetime field looks like 2009-07-27 15:05:00, which is not good enough. So, the only way to store an ISO 8610 date in MySQL is to use a varchar field.

Yeah, the only solution I know of for that on a MySQL level is to store everything as +0/UDT/GMT, and convert as needed. (using a system-level “default” offset, and mathematically manipulating the value for other zones)


Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details