GithubHelp home page GithubHelp logo

wrong day for DST change about eztime HOT 7 CLOSED

dobryj avatar dobryj commented on July 30, 2024
wrong day for DST change

from eztime.

Comments (7)

dobryj avatar dobryj commented on July 30, 2024 1

I found reason.
Problem is on dst_start and dst_end equations.
Hotfix is +1 on "dow" in library (line 741+742) like

time_t dst_start = ezt::makeOrdinalTime(start_time_hr, start_time_min, 0, start_week, start_dow+1, start_month, tm.Year + 1970);
time_t dst_end = ezt::makeOrdinalTime(end_time_hr, end_time_min, 0, end_week, end_dow+1, end_month, tm.Year + 1970);

In detal it is problem on weekday numbering. In ezTime function UTC.weekday() return sunday=1. But posix rule use sunday=0.

from eztime.

ropg avatar ropg commented on July 30, 2024

Ouch, see the same problem here. Looks like something is off. I will look into that urgently later today or tomorrow...

from eztime.

chinswain avatar chinswain commented on July 30, 2024

Same for gb timezone:

UTC: Saturday, 27-Oct-2018 12:00:38 UTC
New Zealand: Sunday, 28-Oct-2018 01:00:38 NZDT
United Kingdom: Saturday, 27-Oct-2018 12:00:38 GMT
Local (GeoIP): Saturday, 27-Oct-2018 12:00:38 GMT

from eztime.

ropg avatar ropg commented on July 30, 2024

I found reason.
Problem is on dst_start and dst_end equations.
Hotfix is +1 on "dow" in library (line 741+742) like

time_t dst_start = ezt::makeOrdinalTime(start_time_hr, start_time_min, 0, start_week, start_dow+1, start_month, tm.Year + 1970);
time_t dst_end = ezt::makeOrdinalTime(end_time_hr, end_time_min, 0, end_week, end_dow+1, end_month, tm.Year + 1970);

In detal it is problem on weekday numbering. In ezTime function UTC.weekday() return sunday=1. But posix rule use sunday=0.

You're absolutely right: a bug indeed, and the fix is exactly as you describe. I will release a new version of ezTime later today.

from eztime.

JasXSL avatar JasXSL commented on July 30, 2024

I'm getting a DST issue here too. Using tz.setLocation(F("Europe/Stockholm")) it's giving me CEST a week in advance. Maybe because this year there are 5 Sundays in March?

from eztime.

ropg avatar ropg commented on July 30, 2024

from eztime.

JasXSL avatar JasXSL commented on July 30, 2024

Yep that update fixed it, thanks

from eztime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.