Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply DST based on the timestamp instead of the current date. #1778

Closed
wants to merge 1 commit into from
Closed

Apply DST based on the timestamp instead of the current date. #1778

wants to merge 1 commit into from

Conversation

Evenprime
Copy link
Contributor

Related thread on the forums: http://community.mybb.com/newreply.php?tid=162091

When "my_date" applies DST in "Automatically detect DST"-Mode (value 2), it doesn't check/respect the timestamps value at all and simply applies DST always/never, based on the current time. This is certainly wrong and potentially confusing, as it retroactively changes the displayed post timestamps (and other dates) whenever the current date switches to/from DST.

@Destroy666x Destroy666x added the b:1.8 Branch: 1.8.x label Jan 25, 2015
@Destroy666x
Copy link
Contributor

#1781

// If DST correction is enabled, add an additional hour to the timezone.
if($dstcorrection == 1)
// If DST correction is enabled and the date falls into DST, add an additional hour to the timezone.
if($dstcorrection == 1 || ($dstcorrection == 2 && date('I', $stamp) == 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are several different rules regarding daylight saving time (and countries not having it at all), it don't think date('I', $stamp) is reliable. It will always apply the British DST rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you are right. Sadly there is no real way to reliably query DST for specific timezones/locations in PHP (that I am aware of). And if there were, it would require users to also tell the country that they live in. :/

So you can probably just close the pull request then and I'll just keep using this method for my forum, where I can rely on almost all guests being from the northern hemisphere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't something like this work? http://stackoverflow.com/a/14423394/1708567 We set it to GMT everywhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but we can't map our timezones (just +1, -5,...) to those timezones...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.. So no solution for this or?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably something we should defer to 2.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably for the best. 2.0 needs a user setting for the country that would be considered for DST calculations at this point.

@Destroy666x Destroy666x added s:rejected Status: Rejected. Invalid report / request which will not be addressed and removed b:1.8 Branch: 1.8.x labels Mar 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:rejected Status: Rejected. Invalid report / request which will not be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants