Comments (3)
The current
format
method is directly based onstrftime
. While this is not that bad
Oh, those %
are just awful visual pollution in %d.%m.%y
vs a simple d.m.y
:(
std::fmt
-inspired syntax.{YYYY}-{MM}-{DD} {hh}:{mm}:{ss.sss} {+xx:xx}
? Not sure about the specifier.
That's another ugliness where 'metadata' take as much space as the data! Could these {}
and %
be reserved only for resolving ambiguity, passing some extra parameters or something, not as the defaults even when they're not needed, i.e. for most of the cases?
- Go's "format-by-example" syntax (http://golang.org/pkg/time/#pkg-constants). Cons: It doesn't fully cover the use case of
strftime
. Possibly we can go with an additional method namedformat_like
.
That's an excellent starting point (as long as the "regrettable historic error" is fixed :))!
from chrono.
FWIW, I'm unlikely to prioritize this until maybe after 0.5 is released. But if someone wanted to prepare a design that can cover all of the current use cases with a better syntax, I'd be happy to review that.
from chrono.
One further thing to note here for anyone wanting to do some experimentation, any new syntax only needs to be compatible with the existing chrono::format::Item
, in which case being able to parse a &str
into an iterator or sequence of these Item
s is sufficient to use the rest of the formatting infrastructure
from chrono.
Related Issues (20)
- time/iana-time-zone 0.1.45 suffer from CVE-2020-26235 HOT 12
- What Is This "DateLike" Black Magic? HOT 6
- Why no From<NaiveDateTime> for NaiveDate? HOT 3
- Example in docs HOT 2
- Some panic cases found by afl.rs HOT 5
- Latest release `0.4.24` uses `time:0.1.45` which has some vulnerabilities HOT 1
- Time crate security vulnerability HOT 1
- How to create local date time with zero hour/minute/second HOT 5
- Missing micros and millis "with" functions since 0.4.23 HOT 1
- Unnecessary `iana_time_zone` dependency? HOT 1
- Why RUSTSEC-2020-0071 after RUSTSEC-2020-0159 solved?
- `Debug` impl of `DateTime` can panic HOT 3
- Converting the API to return Results HOT 13
- Drop the `Datelike` and `Timelike` traits HOT 2
- [Feature Request] `AddAssign`/`SubAssign` implementation to `chrono::Duration` HOT 2
- How to ignore zero padding for parsing the timezone offset? HOT 1
- [Feature Request] implement `Default` for `chrono::Duration` HOT 1
- Pre-Parse strftime string HOT 7
- `try_verify_against_date_command_format` fail when `LANG` is set to other locale HOT 10
- RFC: ditching the time 0.1 dependency on 0.4.x HOT 16
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 chrono.