[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73334":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":45,"readmeContent":46,"aiSummary":47,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":48,"discoverSource":49},73334,"jiff","BurntSushi\u002Fjiff","BurntSushi","A datetime library for Rust that encourages you to jump into the pit of success.","",null,"Rust",2742,103,12,41,0,2,14,42,6,28.05,"The Unlicense",false,"master",[26,27,28,29,30,31,32,33,5,34,35,36,37,38,39,40,41,42,43,44],"calendar","civil","date","date-time","datetime","duration","iana","iso8601","local","rfc2822","rust","strftime","strptime","temporal","time","timezone","tzdb","utc","zone","2026-06-12 02:03:12","Jiff\n====\nJiff is a datetime library for Rust that encourages you to jump into the\npit of success. The focus of this library is providing high level datetime\nprimitives that are difficult to misuse and have reasonable performance. Jiff\nsupports automatic and seamless integration with the Time Zone Database, DST\naware arithmetic and rounding, formatting and parsing zone aware datetimes\nlosslessly, opt-in Serde support and a whole lot more.\n\nJiff takes enormous inspiration from [Temporal], which is a [TC39] proposal to\nimprove datetime handling in JavaScript.\n\n[![Build status](https:\u002F\u002Fgithub.com\u002FBurntSushi\u002Fjiff\u002Fworkflows\u002Fci\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FBurntSushi\u002Fjiff\u002Factions)\n[![Crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fjiff.svg)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fjiff)\n[![Docs.rs](https:\u002F\u002Fimg.shields.io\u002Fdocsrs\u002Fjiff)](https:\u002F\u002Fdocs.rs\u002Fjiff)\n\nDual-licensed under MIT or the [UNLICENSE](https:\u002F\u002Funlicense.org\u002F).\n\n[TC39]: https:\u002F\u002Ftc39.es\u002F\n[Temporal]: https:\u002F\u002Ftc39.es\u002Fproposal-temporal\u002Fdocs\u002Findex.html\n\n### Documentation\n\n* [API documentation on docs.rs](https:\u002F\u002Fdocs.rs\u002Fjiff)\n* [Comparison with `chrono`, `time`, `hifitime` and `icu`](COMPARE.md)\n* [The API design rationale for Jiff](DESIGN.md)\n* [Platform support](PLATFORM.md)\n* [CHANGELOG](CHANGELOG.md)\n\n### Example\n\nHere is a quick example that shows how to parse a typical RFC 3339 instant,\nconvert it to a zone aware datetime, add a span of time and losslessly print\nit:\n\n```rust\nuse jiff::{Timestamp, ToSpan};\n\nfn main() -> Result\u003C(), jiff::Error> {\n    let time: Timestamp = \"2024-07-11T01:14:00Z\".parse()?;\n    let zoned = time.in_tz(\"America\u002FNew_York\")?.checked_add(1.month().hours(2))?;\n    assert_eq!(zoned.to_string(), \"2024-08-10T23:14:00-04:00[America\u002FNew_York]\");\n    \u002F\u002F Or, if you want an RFC3339 formatted string:\n    assert_eq!(zoned.timestamp().to_string(), \"2024-08-11T03:14:00Z\");\n    Ok(())\n}\n```\n\nThere are many more examples in the [documentation](https:\u002F\u002Fdocs.rs\u002Fjiff).\n\n### Usage\n\nJiff is [on crates.io](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fjiff) and can be\nused by adding `jiff` to your dependencies in your project's `Cargo.toml`.\nOr more simply, just run `cargo add jiff`.\n\nHere is a complete example that creates a new Rust project, adds a dependency\non `jiff`, creates the source code for a simple datetime program and then runs\nit.\n\nFirst, create the project in a new directory:\n\n```text\n$ cargo new jiff-example\n$ cd jiff-example\n```\n\nSecond, add a dependency on `jiff`:\n\n```text\n$ cargo add jiff\n```\n\nThird, edit `src\u002Fmain.rs`. Delete what's there and replace it with this:\n\n```rust\nuse jiff::{Unit, Zoned};\n\nfn main() -> Result\u003C(), jiff::Error> {\n    let now = Zoned::now().round(Unit::Second)?;\n    println!(\"{now}\");\n    Ok(())\n}\n```\n\nFourth, run it with `cargo run`:\n\n```text\n$ cargo run\n   Compiling jiff v0.2.0 (\u002Fhome\u002Fandrew\u002Frust\u002Fjiff)\n   Compiling jiff-play v0.2.0 (\u002Fhome\u002Fandrew\u002Ftmp\u002Fscratch\u002Frust\u002Fjiff-play)\n    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.37s\n     Running `target\u002Fdebug\u002Fjiff-play`\n2024-07-10T19:54:20-04:00[America\u002FNew_York]\n```\n\nThe first time you run the program will show more output like above. But\nsubsequent runs shouldn't have to re-compile the dependencies.\n\n### Crate features\n\nJiff has several crate features for customizing support for Rust's standard\nlibrary, `serde` support and whether to embed a copy of the Time Zone Database\ninto your binary.\n\nThe \"[crate features](https:\u002F\u002Fdocs.rs\u002Fjiff\u002F#crate-features)\" section of the\ndocumentation lists the full set of supported features.\n\n### Future plans\n\nMy original plan was to release Jiff 1.0 in Summer 2025. It is now April 2026,\nso that deadline has clearly slipped. I've continued to make progress toward\nJiff 1.0, but it has been more work than anticipated. I don't currently have a\ntimeline for a Jiff 1.0 release.\n\nIt's important to get Jiff 1.0 as \"right\" as possible. Namely, once it's\nreleased, I plan to commit to its API indefinitely. At which point, users of\nJiff should feel comfortable using it as a stable base in public APIs.\n\n### Performance\n\nThe most important design goal of Jiff is to be a high level datetime library\nthat makes it hard to do the wrong thing. Second to that is performance. Jiff\nshould have reasonable performance, but there are likely areas in which it\ncould improve. See the `bench` directory for benchmarks.\n\nNote that performance is still an important goal. Some aspects of Jiff have\nhad optimization attention paid to them, but many still have not. It is a goal\nto improve where we can, but performance will generally come second to API\ncomprehension and correctness.\n\n### Platform support\n\nThe question of platform support in the context of datetime libraries comes up\nprimarily in relation to time zone support. Specifically:\n\n* How should Jiff determine the time zone transitions for an IANA time zone\nidentifier like `Antarctica\u002FTroll`?\n* How should Jiff determine the default time zone for the current system?\n\nBoth of these require some level of platform interaction.\n\nFor discovering time zone transition data, Jiff relies on the\n[IANA Time Zone Database]. On Unix systems, this is usually found at\n`\u002Fusr\u002Fshare\u002Fzoneinfo`, although it can be configured via the `TZDIR`\nenvironment variable (which Jiff respects). On Windows, Jiff will automatically\nembed a copy of the time zone database into the compiled library.\n\nFor discovering the system time zone, Jiff reads `\u002Fetc\u002Flocaltime` on Unix. On\nWindows, Jiff reads the Windows-specific time zone identifier via\n[`GetDynamicTimeZoneInformation`] and then maps it to an IANA time zone\nidentifier via Unicode's [CLDR XML data].\n\nI expect Jiff to grow more support for other platforms over time. Please file\nissues, although I will likely be reliant on contributor pull requests for more\nobscure platforms that aren't easy for me to test.\n\nFor more on platform support, see [`PLATFORM.md`](PLATFORM.md).\n\n[IANA Time Zone Database]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FTz_database\n[`GetDynamicTimeZoneInformation`]: https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwin32\u002Fapi\u002Ftimezoneapi\u002Fnf-timezoneapi-getdynamictimezoneinformation\n[CLDR XML data]: https:\u002F\u002Fgithub.com\u002Funicode-org\u002Fcldr\u002Fraw\u002Fmain\u002Fcommon\u002Fsupplemental\u002FwindowsZones.xml\n\n### Dependencies\n\nAt time of writing, it is no accident that Jiff has zero dependencies on Unix.\nIn general, my philosophy on adding new dependencies in an ecosystem crate like\nJiff is very conservative. I consider there to be two primary use cases for\nadding new dependencies:\n\n1. When a dependency is _practically_ required in order to interact with a\nplatform. For example, `windows-sys` for discovering the system time zone on\nWindows.\n2. When a dependency is necessary for interoperability. For example, `serde`.\nBut even here, I expect to be conservative, where I'm generally only willing\nto depend on things that have fewer breaking change releases than Jiff.\n\nA secondary use case for new dependencies is if Jiff gets split into multiple\ncrates. I did a similar thing for the `regex` crate for very compelling\nreasons. It is possible that will happen with Jiff as well, although there are\nno plans for that. And in general, I expect the number of crates to stay small,\nif only to make keep maintenance lightweight. (Managing lots of semver API\nboundaries has a lot of overhead in my experience.)\n\n### Minimum Rust version policy\n\nThis crate's minimum supported `rustc` version (MSRV) is `1.70.0`. Jiff\nitself, and any dependencies of Jiff within this repository, will never use a\nRust version that requires a Rust compiler released in the previous 1 year.\n(Dependents of Jiff in this repository, e.g., `jiff-icu`, may use a newer MSRV,\nbut never one that is newer than the crate it is trying to integrate with.)\n\nJiff does have other dependencies whose MSRV is outside the control of Jiff\n(for example, `windows-sys` and `portable-atomic`), and it's possible there\nmay be a choice between \"upgrade and increase the MSRV for those targets where\nthe dependency is used\" and \"don't upgrade, retain the MSRV but potentially\nintroduce additional copies of crates into downstream dependency trees.\" While\nsuch instances should be quite rare because of Jiff's conservative dependency\nphilosophy, it's possible it could happen. In which case, I reserve the right\nto make a judgment call that may, in practice, result in a newer-than-1-year\nRust compiler for targets where that dependency is used.\n\nAs is standard in the Rust ecosystem, Jiff does not consider an increase in\nits MSRV to be a semver incompatible change. However, Jiff will limit MSRV\nincreases to minor version updates. For example, if Jiff `1.0` requires Rust\n`1.20.0`, then Jiff `1.0.z` for all values of `z` will also require Rust\n`1.20.0` or older. However, Jiff `1.y` for `y > 0` may require a newer minimum\nversion of Rust. (During Jiff's pre-1.0 releases, MSRV bumps will only occur\nin semver incompatible releases.)\n","Jiff 是一个用于 Rust 的日期时间库，旨在提供难以误用且性能合理的高级日期时间原语。其核心功能包括与时间区域数据库的无缝集成、夏令时感知的算术和舍入操作、无损格式化和解析带有时区的日期时间、可选的 Serde 支持等。该库的设计灵感来源于 JavaScript 中改进日期时间处理的 TC39 提案 Temporal。Jiff 适用于需要精确处理日期时间和时区的应用场景，特别是在开发需要跨时区支持的时间敏感应用时表现尤为出色。","2026-06-11 03:45:04","high_star"]