Comments (9)
Could you be more specific about which type, etc.?
from time.
TimeOfDay
would be the first type. Currently todHour
has a range of 0-23. If it represented a time of day the way ISO-8601 specifies, a TimeOfDay 24 0 0
would be valid and would represent midnight at the end of the day.
I don't know what kind of consequences this change would have for other types and functions. It's very possible that it would be more appropriate to have a separate ISO-8601 library. If you think that's the case, I can go my merry way. I would at least try to make such a library as similar to time and thyme as possible.
from time.
Right now you can construct "TimeOfDay 24 0 0", and you can construct a LocalTime with it, but "makeTimeOfDayValid 24 0 0" will give Nothing.
I'd need to know what operations you'd expect to behave how.
from time.
Currently
(parseTimeM True defaultTimeLocale "%d.%m.%Y %H:%M" "01.01.2021 24:00") :: Maybe UTCTime
evaluates to Nothing
But it should be equal to
(parseTimeM True defaultTimeLocale "%d.%m.%Y %H:%M" "02.01.2021 00:00")
from time.
Hmm, representing 24:00:00 might be a requirement for ISO 8601 formatting/parsing functions.
from time.
OK, I've fixed this for ISO 8601 formatting, where it's required.
from time.
Not sure what to do about parseTimeM
etc.
from time.
So the options are:
- no change: if you want parsing to accept 24:00 then use the ISO 8601 functions
- parsing always accepts 24:00 (changing existing behaviour)
- a flag in
TimeLocale
that determines what to do
For 2 & 3, it's not clear what else should be allowed, e.g., Japanese 30-hour clock, or possibly even other fields out of range rolling over.
from time.
Going to stick with 1 for the time being.
from time.
Related Issues (20)
- Expose functions needed to create `ParseTime` instances HOT 7
- read cannot parse show of ZonedTime HOT 5
- nominalDiffTimeToSeconds - strange result HOT 9
- [Controversial] Problems of `Read` instance of `TimeZone` HOT 5
- Read instance for strings w/o timezone has unclear fatal error message HOT 2
- Parsing padding widths with `parseTimeM` HOT 5
- Handling of days and weeks in CalendarDiffTime HOT 4
- Standard ISO8601 format for `LocalTime` is not padded HOT 4
- instance Enum DiffTime dangerous HOT 4
- Supporting decimal fractions on values other than seconds HOT 5
- reads :: ReadS Data.Time.LocalTime cannot parse show of ZonedTime HOT 3
- Confusing diffGregorianDuration* output HOT 6
- Data.Time.LocalTime.TimeZone is not a timezone but a timezone offset HOT 3
- Parsing of `Day` changed in time-1.11 HOT 1
- TH Lift instances for time types HOT 8
- Get WebAssembly build working HOT 1
- Please provide documentation for Data.Time.Format.ISO8601 HOT 5
- `systemToUTCTime` can produce invalid UTCTime HOT 3
- SecondOfDay and MinuteOfDay types HOT 10
- This library doesn't seem to produce valid UTCTime values. 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 time.