Search

I am about to import tens of thousands of entries to Symphony and I am now very confused about timezones.

Firstly, the Symphony is configured in 'timezone' => 'Europe/Berlin'. There's no data there yet, so it's not late to change that...

In my data, I have full ISO timestamp like this:

<event>Something took place now</event>
<utc-one-time>2011-09-10T13:30:00+01:00</utc-one-time>

Alternatively, I did some testing with shortened version like this:

<event>Something took place now</event>
<utc-one-time>2011-09-10T13:30:00</utc-one-time>

When I Import the data using first source all the times are off by on hour (most likely because the summer time in europe). If I imported the test data with using second source all the times were displayed correct, but, now I started to wonder...

...if I'll import using timestamp format latter example, wouldn't the real times in symphony's database be messed up? How does Symphony handle that? I assume it UTC+02:00 (because it is summer time in Europe now)... But is't it wrong? Also, if the event's took place all around the world and times I have are what they were in CET/CEST at the time the event took place, wouldn't it be messed up in the database?

Could anybody tell me what is the correct way to do this. I have spent 4 days cleaning up messy data collected by others and I want to make sure I will be able reuse and export the data stored in Symphony in the future without any trouble.

I'm not sure if there is any help in this, but I'll go ahead anyways.

I have done some research on Symphony's timezone handling, as I plan to develop a site where different users should be allowed to choose different timezones. Following are my findings.

Symphony's date-field stores data in this format: "2011-10-07T12:48:00+02:00", i.e. timezone-related information is included.

Before making a request to the SQL database, DateTimeObj::get(..) is used, which will call $date = new DateTime(..), and before returning the result $date->format(...) is called (PHP-s built-in datetime-class). From a comment at [http://www.php.net/manual/en/datetime.settimezone.php][1] it seems like this will convert the datetime into the configured timezone.

I concluded that after saving datetimes I can present them as I'd like by running DateTimeObj::setDefaultTimezone(..) before any data is fetched from the database. This function is called for the first time in core.class.symphony.php, in the constructor.

In your case it means that you can import your datetimes (which include timezone information) and symphony will handle the conversions for you without messing with the data.

I'm not an experienced symphony-developer and I could be wrong about this.

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