Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 05:48 pm EDT

Geeklog Forums

mysql timezone machine timezone using NOW() in DB_save


Status: offline

manx801

Forum User
Newbie
Registered: 07/04/04
Posts: 1
I am running geeklog-1.3.9sr1 on my local linux machine that is set to PDT as I live in San Diego CA. mySQL as per usual, has the timezone set to GMT. I noticed that when I post a story as anonymous, the time of the post is displayed correctly, set to my timezone (PDT). However, when I post or edit a story as the story admin, where I have control over the time, the time comes out 7 hours earlier (exactly the PDT offset from GMT). I looked through the story.php code and found that $unixdate is built directly from the date displayed on the story edit page (which is displayed in PDT) and entered into the DB. This is different than the submit.php code which uses NOW() to get the datetime value which, since it comes from the DB, is set in GMT. So stories entered via submit.php are in GMT, and stories entered through story.php are in the local timezone (in my case, PDT). I fixed this with a hack on my machine which checks the local time zone and adjusts the time built from the story edit page to be in GMT before it is entered in the DB.

Sorry if this issue is addressed somewhere else, but I did not find it. It seems to me like there is an issue here with a consistent timezone for datetimes entered into the DB by geeklog given that the same code is used to read and display the story from the DB. Maybe I am just missing something...
 Quote

All times are EDT. The time is now 05:48 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content