Search code examples
phpdatetimezonedst

does php's date_default_timezone_set adjust to daylight saving?


Does php's date_default_timezone_set adjust to daylight saving?

I have this code, and wonder if it will always result in the correct Stockholm time?

  date_default_timezone_set('Europe/Stockholm');
  $timestamp = date("Y-m-d H:i:s");

Solution

  • Yes this should always result in the right time.