Comments (2)
Hi! I'm interested in working on this bug.
from arrow.
If this gets addressed, it would also make sense to change the shift function to account for DST changes. Its hard to say which approach is 'correct', but I think accounting for DST is more natural and would result in fewer errors in code that uses arrow. The current shift behavior ignores DST change on the resulting time:
>>> t1=arrow.get(datetime(2023, 3, 11, 21), 'US/Pacific')
>>> t1
<Arrow [2023-03-11T21:00:00-08:00]>
>>> t2=t1.shift(hours=12)
>>> t2
<Arrow [2023-03-12T09:00:00-07:00]>
Since t1 is not DST and t2 is within DST (clock has move forward), adding 12 hours to t1 would result in a wall-clock time that is 13 hours ahead. Meaning t2 would be <Arrow [2023-03-12T10:00:00-07:00]>
Either approach might confuse someone, but given that a reason to use arrow is timezone awareness (and a big part of most timezones is DST) I'd prefer both DST aware math operations and more DST aware shift.
from arrow.
Related Issues (20)
- Add "T" separator to FORMAT_RFC3339 HOT 2
- Pandas Timestamp from Arrow Object
- passing a parameter to Arrow.shift function (to check for imaginary times or not)
- Fuzzing arrow on OSS-Fuzz HOT 1
- Arrow.humanize() thinks past date is in the future HOT 3
- The dehumanize method doesn't recognize singular nouns HOT 5
- Cannot append nullable string columns to table
- Timezone in multiples of 4. HOT 1
- incorrect tzinfo when arrow.get() HOT 4
- 'arrow' has no attribute 'utcnow' HOT 1
- .humanize() should have a numeric option for 1 instead of a/an HOT 3
- error in Time transform of 9999-12-31 HOT 4
- arrow 1.2.3 doesn't run under Python 3.11 HOT 3
- Missing hour during DST long day when shifting or calculating ranges HOT 3
- No docs on values in format string for Arrow.format() HOT 2
- Use `typing.Self` to support subclassing
- Don't force requirement on types-python-dateutil HOT 3
- incorrect behavior WRT daylight savings for shift/adding timedelta
- 1.3.0: pytest fails in multiple units HOT 2
- RFE: use `zoneinfo` instead of `pytz` HOT 1
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 arrow.