WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 weeks ago

#32141 reopened defect (bug)

Possible bug in human_time_diff() and the_modified_time() native WordPress functions

Reported by: luiscarlospando Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Date/Time Keywords: reporter-feedback
Focuses: Cc:
PR Number:

Description

I've been experiencing problems for a while now on my personal WordPress site in which I have implemented human_time_diff() and the_modified_time() to display the date and time of my blog posts. They usually display the wrong time and date.

Since I'm only echoing them in my templates I think is a problem of the WordPress core.

I actually hoped this bug would get fixed on WordPress 4.2 but it actually keeps showing me the wrong date and time.

Whenever I post a new entry it says it's been posted 6 hours ago, when in reality it's been posted not less than a minute ago. I began to experience this issue since a WordPress update, I don't really remember which version was.

For everyone's reference, my blog is http://blog.luiscarlospando.net/ (it's in spanish).

Change History (11)

#1 follow-up: @SergeyBiryukov
4 years ago

  • Component changed from General to Date/Time
  • Keywords reporter-feedback added

Hi @luiscarlospando, welcome to Trac!

Does the issue still happen with all plugins disabled and a default theme (Twenty Fifteen or Twenty Fourteen) activated?

#2 in reply to: ↑ 1 @luiscarlospando
4 years ago

Replying to SergeyBiryukov:

Hi @luiscarlospando, welcome to Trac!

Does the issue still happen with all plugins disabled and a default theme (Twenty Fifteen or Twenty Fourteen) activated?

Hello @SergeyBiryukov and thank you so much for your help, I just deactivated all my plugins and i just tried to view my current theme, the_modified_time() seems to be working fine, but human_time_diff() still keeps showing me the "6 hours ago" text whenever I update a post or post a new one.

Since Twenty Fifteen or Twenty Fourteen don't make use of human_time_diff() how can I tell? Do you suggest I tweak those themes?

All of my plugins are deactivated now.

#3 @luiscarlospando
4 years ago

  • Summary changed from Posible bug in human_time_diff() and the_modified_time() native WordPress functions to Possible bug in human_time_diff() and the_modified_time() native WordPress functions

#4 @luiscarlospando
4 years ago

  • Keywords reporter-feedback removed

#5 follow-up: @DrewAPicture
4 years ago

@luiscarlospando: It would also be helpful to know what your local timezone is and what timezone your WordPress is set to in Settings > General.

#6 in reply to: ↑ 5 @luiscarlospando
4 years ago

Replying to DrewAPicture:

@luiscarlospando: It would also be helpful to know what your local timezone is and what timezone your WordPress is set to in Settings > General.

My current local time zone is: http://www.worldtimezone.com/time/wtzresult.php?CiID=1345&forma=24h

My WordPress timezone is set to Chihuahua.

#7 @luiscarlospando
4 years ago

I would like to know the status of this ticket, somebody know if there is there any bug present in the core?

#8 @Rarst
16 months ago

  • Keywords reporter-feedback added

There are number of serious issues in current Date/Time implementation, which can exhibit in all manner of errors as they trickle through function calls towards output.

Unfortunately there isn't enough information here to tell why that specific function fails in that specific way. As far as I know there is no specific outstanding bug with human_time_diff() itself, so the issue is likely lower level.

Given the age of the issue and lack of additional reports it should probably be closed, unless more sufficient details appear.

#9 @Rarst
16 months ago

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

#10 @orionexodus
5 weeks ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

I am currently facing the same problem and I'm quite sure why it's happening. I'm using Cloudflare as Proxy between my server and the internet. My guess is that its somehow confused with the timezone of Cloudflare and my local Timezone... Could this be possible?

#11 @Rarst
5 weeks ago

As above this needs way more specific information on what the inputs and code are, as well as how resulting output is wrong.

A web proxy should have no impact on PHP runtime environment on your server, it just deals with resulting HTML output.

Note: See TracTickets for help on using tickets.