Comments (4)
Ohhh, that is confusing. I would to happy to merge a pull request if you have the time.
from zig-tzif.
I've made a draft here: #6
Turns out this is some rabbit hole to go down... Before I can proceed with this, I'll have to get a clear understanding of your concept :)
- The method
PosixTZ.offset()
- is it supposed to take Unix time in seconds and return the corresponding UTC offset of given time zone? Is that correct? - Same goes for
TimeZone.localTimeFromUTC()
I suppose? (--> Unix time + corresponding UTC offset)
from zig-tzif.
- The method PosixTZ.offset() - is it supposed to take Unix time in seconds and return the corresponding UTC offset of given time zone? Is that correct?
Yep, that's correct. It takes a unix timestamp in seconds and returns what the UTC offset is at that time based on the rules around Daylight Saving Time.
- Same goes for TimeZone.localTimeFromUTC() I suppose? (--> Unix time + corresponding UTC offset)
And this is also correct, if I understand what you're saying. It takes a Unix timestamp in UTC and converts it into a timestamp in the given timezone.
from zig-tzif.
right, I think the missing part was subtracting the offset, which you have now added here
const start_dst = range.start.toSecs(utc_year) - this.std_offset;
const end_dst = range.end.toSecs(utc_year) - this.dst_offset;
from zig-tzif.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zig-tzif.