Jump to content

energylevel

New Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

energylevel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This snippet of code outputs stored date to UK local time with daylight saving, trying to convert it to MySQLi ? date_default_timezone_set(‘Europe/London’); mysql_query(“SET `time_zone` = ‘”.date(‘P’).”‘”);
  2. This seemed to sort as a quick solution: <?php date_default_timezone_set('Europe/London'); mysql_query("SET `time_zone` = '".date('P')."'"); ?>
  3. How to output a MySQL timestamp field to correct local time with daylight saving with PHP? Local time is set in php.ini with: date.timezone = "Europe/London" Confirmed set with: <?php echo date_default_timezone_get(); ?> But when I echo the timestamp field it does not display correct UK time for the record (an hour behind correct UK time). <?php echo date('jS F Y - g:ia', strtotime($row['Date'])); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.