Comments (4)
It looks like named timezones are just ignored in parse.rs. The comment suggests that the C's original strptime
is broken.
println!("{}", time::strptime("Tue Jan 01 12:37:48 GMT 2013", "%a %b %d %T %Z %Y").unwrap() ==
time::strptime("Tue Jan 01 12:37:48 ETC 2013", "%a %b %d %T %Z %Y").unwrap());
=> true
However using time offsets does work
println!("{}", time::strptime("Tue Jan 01 12:37:48 +00:00 2013", "%a %b %d %T %z %Y").unwrap() ==
time::strptime("Tue Jan 01 12:37:48 +05:00 2013", "%a %b %d %T %z %Y").unwrap());
My workaround's going to be string replacement (for now).
Perhaps there could be another parse function that does what's expected?
from time.
My current thought is to drop the "support" for %Z
in 0.2. That specific formatting option requires knowledge of the actual timezone, not just the offset, and this info isn't stored anywhere. Parsing may happen, though it isn't likely.
from time.
The minimal support for %Z
has been completely dropped for 0.2.
from time.
Closing in favor of #193, which would include this.
from time.
Related Issues (20)
- Cargo error: `serde` conflict with `time v0.3.26` crate HOT 4
- Relax back `serde` dependency HOT 17
- Well-known format descriptions should support formatting Date. HOT 4
- The log CAN NOT display the time correctly in the LINUX with tracing_subscriber::fmt().with_timer(LocalTime::rfc_3339()) HOT 2
- error[E0557]: feature has been removed HOT 10
- errored when execute in `cargo llvm-cov` HOT 1
- Arithmetic overflow occurs HOT 4
- Missing panic condition on API docs HOT 4
- Release with coverage fix HOT 1
- Arithmetic crash occurs HOT 1
- `Weekday` and `Time` (and probably more types) do not respect formatting flags HOT 2
- Panic when `nth_next_occurrence` and `nth_prev_occurrence` get `n = 0` HOT 2
- no localtime on openbsd HOT 6
- Support providing default values during parsing HOT 1
- Sub-millisecond component inaccuracy in OffsetDateTime conversion from js_sys::Date HOT 1
- Can i try to implement `Time::parse` equivalents? HOT 1
- Unexpected behavior of `time::serde::rfc3339::option::deserialize()` HOT 3
- OffsetDateTime lacks an obvious constructor
- Implement `arbitrary::Arbitrary` trait for exported types HOT 2
- [feature request] Serde support unix timestamps in millisecond precision 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.