WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#125 closed enhancement (fixed)

problem with timestamps when blog timezone and server timezone differ

Reported by: donpaolo Owned by: matt
Milestone: Priority: normal
Severity: normal Version: 1.2
Component: Administration Keywords:
Focuses: Cc:

Description

I work in a country with timezone=-4, and I put this value in my user options.

However, the server where the blog runs has timezone=+2.

When I post a messagge, it doesn't appear in the main page, if I post it with gnome-blog (metaweblog API).

Examining the database with phpMyAdmin, I see that the field post_date_gmt isn't correct: instead of showing 8:43, it shows 18:43. Hence the post, though appears published, isn't show in the main page.

It could be because of a incorrect management of timezones: instead of calculating

post_date_gmt = [server_post_time] - [+2 (server t/z)] + [-4 (blog t/z)] = post_time - 6

supposedly it calculates

post_date_gmt = [server_post_time] + [+2 (server t/z)] - [-4 (blog t/z)] = post_time + 6

I saw that the problems appear in the same form if I change my wordpress user timezone. I checked it with -3, -5, -6, -9, etc.

It could be a problem in the metaweblog API.

Change History (4)

comment:2 @donpaolo11 years ago

the post_date_gmt field gets right if I edit the post, set the edit timestamp flag and save.

comment:3 @anonymousbugger11 years ago

The problem could be temporarily resolved (at least with reference to gnome-blog) commenting out line 1303

$post_date_gmt = get_gmt_from_date(date('Y-m-d H:i:s', $dateCreated));

in the function mwnewpost of the / metaWeblog API /

comment:4 @matt11 years ago

  • fixed_in_version set to 1.5
  • Owner changed from anonymous to matt
  • Resolution changed from 10 to 20
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.