Issue Bug Closed

#51918Native date and datetime values do not consider timezone

Oliver Hader 09/11/13, 16:01 updated 10/02/18, 12:10

Description

The TCA configuration property “dbType” allows to store “date” or “datetime” values directly in the database (instead of using a timestamp value).
However, the timezone is not recognized correctly – besides that, the serverTimeZone is applied which does not make much sense at all, since it leaves out DST handling.

See #32081 for a full description on how times/dates are stored in TYPO3 and how they are converted.

The current scenario is:
  • being on GMT+0200 (Europe/Berlin with DST – which is “CEST”)
  • serverTimeZone is set to “1” in Install Tool
  • using the time “2013-09-30 00:00:00”
  • timestamp (UTC) representation is sent to DataHandler
    • “1380499200”
  • incoming fields are converted to represent the native date
    • “2013-09-30 *02*:00:00” (because using date() instead of gmdate())
    • “2013-09-30 00:00:00” would be correct here
  • native date is converted to timestamp again (should be UTC still)
    • “1380492000” (7200 seconds are missing, due to wrong timezone handling)
    • “1380499200” would be correct (as submitted to DataHandler)
  • serverTimeZone is added
    • “1380495600” (3600 seconds are missing)
    • “1380499200” would be correct (as submitted to DataHandler)
  • timezone offset is substracted
  • timestamp gets converted back to native date
    • “1380488400” -> “2013-09-29 23:00:00”
    • “1380492000” would be correct (timezone cleared value for local date() handling)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.