Comments (10)
I wasn't aware of this behaviour and something I will have to look into the usage of dateutil
.
from delorean.
this is related also to this bug i think? #99
from delorean.
@gordol was this related, can this be closed?
from delorean.
It's a dateutil issue upstream. Not fixed and they aren't planning to fix any time soon it seems.
from delorean.
@gordol did they give a reason?
from delorean.
i think this is actually a different bug...
dateutil/dateutil#149 (comment)
that is the reason given. basically, it implements an old RFC.
from delorean.
delorean basically just implements dateutil.parser.parse
This module attempts to be forgiving with regards to unlikely input formats, returning a datetime object even for dates which are ambiguous. If an element of a date/time stamp is omitted, the following rules are applied: - If AM or PM is left unspecified, a 24-hour clock is assumed, however, an hour
on a 12-hour clock (0 <= hour <= 12) must be specified if AM or PM is specified.
If a time zone is omitted, a timezone-naive datetime is returned.
If any other elements are missing, they are taken from the datetime.datetime object passed to the parameter default. If this results in a day number exceeding the valid number of days per month, the value falls back to the end of the month.
Anyway, this led me down a journey into dateutil... and it seems this may have been fixed in 2.5?
currently delorean lists dateutil 2.4.2 as the required version.
however, i think there are some other issues in dateutil after 2.5.1...
so you may want to stick with 2.5.1 for now.
see the changelog here where this was fixed in 2.5.0:
https://github.com/dateutil/dateutil/blob/38232aacc3c46ef3b649ec730a2444ed13fe3894/NEWS#L150
from delorean.
2.6 has a new parsing overhaul, so maybe give it a whirl?
from delorean.
from delorean.
you can pass a default date to the parse() method also... to work around this. or you can simply set the first day of your date string to "1" to be first day of month. by default it uses the current day's date.
from delorean.
Related Issues (20)
- Pip package is not updated HOT 2
- parse function does not parse date string correctly
- Publish New Version HOT 5
- Language support HOT 1
- Fix simple typo: specificed -> specified
- mistake in parse example HOT 1
- zoneinfo.ZoneInfo AttributeError while parsing within the Django context HOT 1
- mock requirement could be optional
- PytzUsageWarning "normalize method is no longer necessary" when using delorean.parse()
- #118
- Issue with tzlocal==5.0
- Fix midnight() and naive() references on Quickstart page HOT 2
- Strict ISO 8601 parser HOT 1
- Add a wrapper for babel's parse_pattern() HOT 2
- Delorean.now() accepts timezone while delorean.now() does not
- parser failling in RFC3339 format HOT 1
- delorean.dates.UTC is gone in 0.6.0
- Some kind of time delta for localized "business days"
- Delorean.shift does not take datetime.timezone.utc HOT 3
- stops() skips february??? HOT 2
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 delorean.