WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#12885 new defect (bug)

LiveJournal importer uses GMT date/time as local date/time

Reported by: kurtmckee Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version:
Component: Import Keywords: has-patch needs-testing
Focuses: Cc:

Description

The LiveJournal importer takes a comment's date/timestamp, which is in GMT, and inserts it into the database as the comment's local date/timestamp. In my timezone (U.S. Central, DST), a comment posted at 12:00pm local time (5:00pm GMT) will be imported to the database as having been posted at 5:00pm local time (10:00pm GMT).

I've attached a patch that I've successfully tested on Wordpress 2.9.2, and it appears to be easily ported to trunk. One caveat: it appears that there are two timezone settings in the Wordpress database (timezone_string and gmt_offset), but as my database has no value for gmt_offset, I don't know if I need to account for that, nor can I test that.

Attachments (2)

lj-comment-datetimes.diff (654 bytes) - added by kurtmckee 4 years ago.
Adjust LiveJournal comment dates and times from GMT to local time (applies to WP 2.9.2)
12885.diff (1.1 KB) - added by kawauso 3 years ago.
Patch #12885 and #5842 with get_date_from_gmt()

Download all attachments as: .zip

Change History (9)

kurtmckee4 years ago

Adjust LiveJournal comment dates and times from GMT to local time (applies to WP 2.9.2)

comment:1 Frumph4 years ago

Note about the gmt_offset, my installation didnt have a value in it either, after upgrading from wpmu to 3.0

comment:2 nacin3 years ago

  • Milestone changed from Awaiting Review to WordPress.org site

comment:3 kurtmckee3 years ago

Has anyone had an opportunity to review the patch? Are there any suggestions that I should incorporate in order to make the code acceptable to commit?

comment:4 nacin3 years ago

I think we have a function somewhere to do that conversion -- would it be get_date_from_gmt?

comment:5 kurtmckee3 years ago

Thanks for the quick response and the tip! I'll look for that function (or a similar one), update the patch to work with trunk, and test it as soon as possible.

comment:6 kawauso3 years ago

Related: #5842

kawauso3 years ago

Patch #12885 and #5842 with get_date_from_gmt()

comment:7 kawauso3 years ago

  • Keywords has-patch needs-testing added

Patch with get_date_from_gmt(), but no LiveJournal account to test with here

Note: See TracTickets for help on using tickets.