Make WordPress Core

Opened 14 years ago

Last modified 5 years ago

#12885 new defect (bug)

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

Reported by: kurtmckee's profile kurtmckee Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Import Keywords: has-patch needs-testing
Focuses: Cc:


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 14 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 13 years ago.
Patch #12885 and #5842 with get_date_from_gmt()

Download all attachments as: .zip

Change History (11)

14 years ago

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

#1 @Frumph
14 years ago

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

#2 @nacin
13 years ago

  • Milestone changed from Awaiting Review to site

#3 @kurtmckee
13 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?

#4 @nacin
13 years ago

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

#5 @kurtmckee
13 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.

#6 @kawauso
13 years ago

Related: #5842

13 years ago

Patch #12885 and #5842 with get_date_from_gmt()

#7 @kawauso
13 years ago

  • Keywords has-patch needs-testing added

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

#8 @chriscct7
10 years ago

Related (in terms of updating the LJ Importer plugin): #15760

#9 @chriscct7
8 years ago

Based on #5842 this might be invalid

Note: See TracTickets for help on using tickets.