This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Incorrect timestamp in comments
#1

Hi
When previewing the comment, the timestamp shows the correct time. However, when adding the comment, the timestamp in the comment changes and shows two hours earlier than the preview.
Regards
Nils
Reply
#2

Hi,

I'm glad this issue came up because I have attempted to fix this in the current development version and it would be helpful to find out if the fix works.

Basically your MySQL server is in a different location to your web server, and your MySQL server is missing the time zone definitions. It's the same as this thread, see post #6.

However, instead of using the solution in that thread:

PHP Code:
<?php 
@mysql_query("SET time_zone = '-8:00'"); //set time zone DB

Can you try this solution and let me know if it works:

PHP Code:
<?php 
@mysql_query("SET time_zone = '" . date("P") . "'"); //set time zone DB

The line doesn't require any editing.

Have you completed the interview?
Reply
#3

(11-Sep-2012, 10:17 AM)Steven Wrote:  Hi,

I'm glad this issue came up because I have attempted to fix this in the current development version and it would be helpful to find out if the fix works.

Basically your MySQL server is in a different location to your web server, and your MySQL server is missing the time zone definitions. It's the same as this thread, see post #6.

However, instead of using the solution in that thread:

PHP Code:
<?php 
@mysql_query("SET time_zone = '-8:00'"); //set time zone DB

Can you try this solution and let me know if it works:

PHP Code:
<?php 
@mysql_query("SET time_zone = '" . date("P") . "'"); //set time zone DB

The line doesn't require any editing.
Ah, OK I understand.

The fix you suggested worked! Now both preview and comment time stamp show correct time.

Thank you!
/N
Reply
#4

Ok, thanks for the confirmation.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
13-Aug-2021, 08:01 AM
Last Post by The_Phantom
29-Jul-2021, 12:14 PM
Last Post by 2hands
18-Nov-2017, 11:21 PM
Last Post by Rameshrao55
30-Sep-2015, 08:49 PM
Last Post by Deparis
21-Jul-2014, 10:39 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)