WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#6489 closed defect (bug) (fixed)

Revisions do not respect time zone offset

Reported by: sillybean Owned by:
Milestone: 2.7.1 Priority: high
Severity: major Version: 2.5
Component: Revisions Keywords: autosave revision timezone offset has-patch dev-feedback needs-testing
Focuses: Cc:

Description

The timestamp on the autosave message doesn't include the time zone offset. The reported time is therefore confusing.

Attachments (3)

post-template.php.diff (697 bytes) - added by janbrasna 10 years ago.
admin-ajax.php.diff (546 bytes) - added by janbrasna 10 years ago.
6489-admin-ajax.php-post-template.php.diff (1.2 KB) - added by janbrasna 10 years ago.
Fixes #6489, obsoletes previous patches.

Download all attachments as: .zip

Change History (24)

#1 @sillybean
10 years ago

  • Milestone 2.5.1 deleted
  • Summary changed from Autosave does not respect time zone offset to sorry, forgot not to set that milestone!

#2 @sillybean
10 years ago

  • Summary changed from sorry, forgot not to set that milestone! to Autosave does not respect time zone offset

#3 @Viper007Bond
10 years ago

Yeah, I had this occur to me the other day and confused the hell outta me.

#4 @lloydbudd
10 years ago

  • Milestone set to 2.6

#5 @Viper007Bond
10 years ago

Also see this dupe: #6563

#6 @janbrasna
10 years ago

  • Keywords revision timezone offset added
  • Milestone changed from 2.9 to 2.7
  • Priority changed from low to high
  • Severity changed from minor to major
  • Summary changed from Autosave does not respect time zone offset to Revisions do not respect time zone if offset differs between settings and server

It's not only autosave, the whole revision system uses server time zone for display.

I think that the severity is rather high, because it leads to using wrong versions or total confusion.

Basically it's borked at the point when the datetime of a revision is retrieved via GMT since it's then converted via date_i18n to TZ of the server. Additionally any TZ info of the original revision is lost (imagine you change TZ for daylight savings and then the math via GMT fails to show the original time the revision was saved.) There's AFAIK no reason not to use the actual date with offset info from the DB for displaying it.

Attaching patch, please review.

#7 @janbrasna
10 years ago

The same TZ issue is in the inline flash, see another patch.

#8 @janbrasna
10 years ago

  • Keywords has-patch added

#9 @janbrasna
10 years ago

  • Keywords dev-feedback added
  • Summary changed from Revisions do not respect time zone if offset differs between settings and server to Revisions do not respect time zone offset

#10 @janbrasna
10 years ago

  • Cc janbrasna added

#11 @janbrasna
10 years ago

  • Keywords needs-testing added

Also see this dupe: #8307

#12 @markjaquith
10 years ago

  • Milestone 2.7 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Works for me... I'm seeing my offset correctly reflected. Reopen if still an issue in WP 2.7 final

#13 @janbrasna
10 years ago

  • Milestone set to 2.7
  • Resolution worksforme deleted
  • Status changed from closed to reopened

The bug is still present as of 2.7-RC1-10151 and 2.7-RC2.

Please make sure when tagging as worksforme that you have the same conditions/setup. This bug only occurs when user's local and server time zones differ, see comment:6 ...

I'm attaching a new combined patch which is quite self–explanatory and tested with various time zone combinations, I'd just appreciate some dev-feedback, otherwise it could be checked in.

@janbrasna
10 years ago

Fixes #6489, obsoletes previous patches.

#14 @DD32
10 years ago

  • Milestone changed from 2.7 to 2.7.1

Bumping to 2.7.1

#15 follow-up: @murky
10 years ago

If I make the changes in the patches above, does this fix this bug?

#16 in reply to: ↑ 15 @janbrasna
10 years ago

Replying to murky:

If I make the changes in the patches above, does this fix this bug?

Yes. Use the last patch: 6489-admin-ajax.php-post-template.php.diff

#17 follow-up: @murky
10 years ago

Thanks, I asked as it wasn't marked as 'resolved' - and wondered if there was a little more to fix.

#18 in reply to: ↑ 17 @janbrasna
10 years ago

Replying to murky:

as it wasn't marked as 'resolved'

It's just not marked as fixed since it's not checked in the trunk yet.

#19 @ryan
9 years ago

  • Component changed from Administration to Revisions

#20 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [10490]) Respect time zone when displaying autosave and revision time. Props janbrasna, designsimply. fixes #8750 #6489 for trunk

#21 @ryan
9 years ago

(In [10491]) Respect time zone when displaying autosave and revision time. Props janbrasna, designsimply. fixes #8750 #6489 for 2.7

Note: See TracTickets for help on using tickets.