Re:Jiff 1.0: A datetime library for Rust
by dmit on Monday November 16, 2026 @12:58PM
(#50520614)
Yeah, that makes a ton of sense until you get into the time zone weeds, and leap seconds and whatnot. It just makes sense to keep all that crud out of the six-week release cycle and in the realm of third-party libraries.
Re:Jiff 1.0: A datetime library for Rust
by AeroNotix on Monday November 16, 2026 @02:27PM
(#50521846)
Andrew had a pretty decent impact on the course of my career and I doubt he even remembers it or even thought of it as an act of good he did.
In the very early Go days (<0.9) he responded to a comment of mine going into why Go was worth looking into, quite passionately and enthusiastically which set me off on learning it and where it could be applied and that changed the kinds of roles I went after.
Ever since it's a bright little nugget whenever I see his name pop up and have tried to follow his work ever since.
Re:Jiff 1.0: A datetime library for Rust
by notstayinglong on Monday November 16, 2026 @07:17PM
(#50525584)
To go full circle, the original Greek pronunciation of ph was as an aspirated p, which is how English pronounces all p's (except when preceded by an s), so we're back to "jay-peg"
Re:Jiff 1.0: A datetime library for Rust
by tredre3 on Monday November 16, 2026 @12:58PM
(#50520610)
Rust doesn't even have an async runtime in its standard library, despite async being part of the language. They believe increased reliance on third party dependencies is better for the ecosystem. Things like supply chain risks or disparate documentation or conflicting dependencies or enormous .cargo are seen as less of a problem than having a built-in API that could go stale one day.
Re:Jiff 1.0: A datetime library for Rust
by afdbcreid on Monday November 16, 2026 @01:32PM
(#50521056)
As I've said in other places, supply chain risks have nothing to do with things not being in std, only with them not being official - and things can be (and are) official without being included in std.
Documentation certainly has nothing to do with it.
Re:Jiff 1.0: A datetime library for Rust
by hmry on Monday November 16, 2026 @02:57PM
(#50522282)
> disparate documentation
Never have experienced this once while using a Rust library. They are all using rustdoc hosted on docs.rs (or locally with $ cargo doc). They all look identical and there's a single global search bar that searches all your dependencies.
> conflicting dependencies
Since you can install two different versions of the same library, this is only an issue if two of your dependencies both expose a transitive dependency with different versions in their external APIs. (E.g. libA returns a Foo 1.0 and libB expects an argument of Foo 2.0) Only library I have ever run into this with is raw-window-handle.
> supply chain risks
> enormous .cargo
These I agree with. Although honestly the supply chain risk is not as big with these foundational libraries as it would first appear, since they are almost all maintained by the same 5 rust compiler developers. Really the only difference is that they're not in the rust-lang github organization and not shipped precompiled with the standard library
Re:Jiff 1.0: A datetime library for Rust
by JoshTriplett on Monday November 16, 2026 @03:11PM
(#50522485)
> They believe increased reliance on third party dependencies is better for the ecosystem.
Not at all. We just want to avoid having the standard library be "where code goes to die", as Python folks have put it.
We're working on adding more popular APIs from the ecosystem to the standard library. See https://github.com/rust-lang/std-replacement-data/ for a data set tracking what crates have been obsoleted by additions to the standard library; we hope to increase that over time.
Re:Jiff 1.0: A datetime library for Rust
by dminik on Monday November 16, 2026 @01:01PM
(#50520649)
Any modern language recognizes that some things are inherently complex and will always have tradeoffs that certain users won't be satisfied with and that will be locked in forever. Such modern languages then let users pick whatever approach they actually need by implementing sensible package management.
Re:Jiff 1.0: A datetime library for Rust
by darksaints on Monday November 16, 2026 @01:34PM
(#50521082)
A default standard encompassing the most common usecases is a completely reasonable approach. Having a date/time library in the standard library does not preclude other libraries, it just makes it the default and keeps ecosystem integration sane. Not to mention the massive potential reduction in supply chain attacks.
Re:Jiff 1.0: A datetime library for Rust
by masklinn on Monday November 16, 2026 @02:13PM
(#50521643)
Having a date/time library in the standard library actually makes it very difficult for other libraries to take off, and when it's deeply deficient (which is generally the case, turns out time is quite hard) it's actively detrimental to users of the ecosystem, both because it's hell to use and because it teaches them to do things incorrectly. Which then makes an innovative library have a harder time take off, because they need to fix most of their possible users.
Re:Jiff 1.0: A datetime library for Rust
by kbolino on Monday November 16, 2026 @02:19PM
(#50521739)
In this particular matter, I can't help but be biased against your perspective due to Go. In that language, the desire to meet the "most common usescases" has led to an IMO pathologically bad attitude towards doing this right. In Rust, only the bare primitives are exposed -- Instant, SystemTime, Duration -- but these are sufficient for others to build better abstractions. Whereas, in Go, all of the primitives are hidden behind a "good enough" (it's not) API, and you have to break out O/S-specific code if you want to do better.
Re:Jiff 1.0: A datetime library for Rust
by darksaints on Monday November 16, 2026 @02:36PM
(#50521958)
Java had the same problem, but then they then fixed with `java.time`, which I believe should be the benchmark for off-the-shelf date/time functionality. Doing it right absolutely is a management and leadership problem, and management/leadership can fail, but when it is done right the result is so much better than the bazaar of 20 half-baked mutually incompatible solutions.
Re:Jiff 1.0: A datetime library for Rust
by kbolino on Monday November 16, 2026 @02:42PM
(#50522068)
I don't agree that Java had the same problem. Java has had System.currentTimeMillis() since the beginning, and System.nanoTime() since 2005. Meanwhile, in Go, time.Now().Unix() performs a pointless timezone lookup and time.Since(foo) only uses the monotonic clock if foo has monotonic time, a property of time.Time values that you can't interrogate.
Re:Jiff 1.0: A datetime library for Rust
by solidsnack9000 on Monday November 16, 2026 @01:02PM
(#50520668)
I'm not sure this makes sense for a systems programming language -- but I can see it for an application programming language.
For a systems programming language, Rust is relatively easy to write applications in -- but I suspect standard library choices (and other choices) will be driven by the systems side for the foreseeable future.
Re:Jiff 1.0: A datetime library for Rust
by procaryote on Monday November 16, 2026 @03:56PM
(#50523136)
Java has a pretty good approach of promoting the more popular library for a thing to standard library status, with relatively minor changes. It's an easy way to get a really good standard library over time, as it's already proven in practice
Re:Jiff 1.0: A datetime library for Rust
by Sharlin on Monday November 16, 2026 @04:41PM
(#50523694)
And Java needed two very flawed attempts before finally getting it more-or-less right (and as you said, it was a third-party library in the end that was adopted rather than one designed by the core developers.)
Re:Jiff 1.0: A datetime library for Rust
by lambda on Monday November 16, 2026 @01:27PM
(#50520987)
The problem with this model is that then you try to build all of the libraries that you anticipate users are going to need in one big go before you release version 1 of you language. Because you're trying to do a lot at once, they don't ask get the proper attention they deserve. Then, because of stability guarantees, you're stuck only making backwards compatible changes in the future (or you risk either constant breaking changes, or big changes where a lot changes at once forking the ecosystem, like Python 2 to 3). So if you made any mistakes in the library, you're stuck with them, only being about to deprecate but never really remove them.
The alternative is to keep a relatively small standard library, and a good package manager, to make it easier for people to iterate on API design in third party packages. Major version changes in a single library can have much less impact accross the ecosystem than standard library packages. Eventually you may get a de facto standard, and sometimes they are then later incorporated into the standard library.
This model isn't without its downsides; it can sometimes mean fragmentation when standardization would help, sometimes these de facto standard libraries can become important enough that they run into the same ecosystem fragmentation issues on major releases. But it allows for more flexibility.
The latter model is what the Rust project decided on for everything outside of the most fundamental time types. Dates and times and timezones are notoriously hard to model in code, and easy to create API designs that are full of footguns, so this is a place where that extra freedom to iterate was more important than standardizing on an API early on.
That iteration has led to a number of different libraries, including time, chrono, and now jiff, allowing for exploring the space of API design to really get it right rather than being stuck with what was available early on.
Re:Jiff 1.0: A datetime library for Rust
by Sharlin on Monday November 16, 2026 @04:38PM
(#50523666)
Jiff is exactly the reason Rust doesn't ship a datetime library - at least not yet. It took many years and several attempts to get to this point. It would've been an extremely severe mistake to include datetime in std and then be forced to maintain a likely flawed API for all eternity. Luckily Rust devs knew and know better.
Re:Jiff 1.0: A datetime library for Rust
by the__alchemist on Monday November 16, 2026 @01:06PM
(#50520713)
I will give this a shot, however... Rust is the only language I've used where I want to use the established one, chrono. I will roll my own in JS, for example, or begrudgingly use or wrap the python.datetime one (And not touch the third party python ones which do awful things inspired by Moment.js like conflating dates , times, and datetimes, under the guise dates and times don't have use on their own), but Chrono actually is comparatively nice (S-tier relative to others), both std and no_std.
Re:Jiff 1.0: A datetime library for Rust
by the__alchemist on Monday November 16, 2026 @01:40PM
(#50521178)
Ty for the details! That is about as clear as anyone could hope!
This is still very surprising given the context; if the top datetime library of any language is getting soft-replaced with something nicer, woe be to those in other languages!
Re:Jiff 1.0: A datetime library for Rust
by ddahlen on Monday November 16, 2026 @01:11PM
(#50520783)
This looks interesting!
Time is such a pain, I write code for simulating orbits of asteroids/stuff in the solar system, and time and time conversions play a major roll in it. I often need accuracy at the mega-year to giga-year scales, but also sometimes micro-second relative.
I saw on this page that you at least mention TAI time, how are you handling time scales in general? Like would it be hard to add some other timescales like UT1?
Right now I have to do all of this manually and I have been using chrono as just a convenience wrapper so that my users can convert ISO time strings into my internal representation.
Edit: Oh no! I just found out chrono is being semi-deprecated, looks like I'm going to be switching...
Re:Jiff 1.0: A datetime library for Rust
by burntsushi on Monday November 16, 2026 @01:13PM
(#50520811)
Jiff only supports the Unix time scale. It sounds like you probably want `hifitime` instead! I believe it was designed with your use case in mind. See: https://docs.rs/hifitime/
Re:Jiff 1.0: A datetime library for Rust
by ddahlen on Monday November 16, 2026 @01:22PM
(#50520922)
Thanks for making useful tools!
Ah yeah hifitime, I tried it out but its internal representation doesn't work well for my long term simulations, the integer representation ends up increasing the numerical noise in my simulations when I do really sensitive long term ones.
Re:Jiff 1.0: A datetime library for Rust
by pbrowne011 on Monday November 16, 2026 @01:13PM
(#50520813)
Nice! I appreciated the documentation for tzdb and the thought process behind using "rearguard" data [1]. Some related GitHub issues are also worth reading [2] [3].
Re:Jiff 1.0: A datetime library for Rust
by Dagonfly on Monday November 16, 2026 @01:54PM
(#50521382)
> When should I use Jiff? Jiff isn’t always the right thing to use.
I really appreciate when a project calmly acknowledges that it's not the right tool for every use case, and is not trying to be. That's professional engineering.
Especially in the AI-age, the crucial skill will be what NOT to implement.
Re:Jiff 1.0: A datetime library for Rust
by BrandoElFollito on Monday November 16, 2026 @06:06PM
(#50524842)
I always use a time library (in Python and TS). If you work on time intervals in seconds, fine, you can use what is built-in. But I favor consistency and everything time is a time library object for me.
Outside of this not using a timer library is going for a world of pain
Re:Jiff 1.0: A datetime library for Rust
by quodlibetor on Monday November 16, 2026 @01:57PM
(#50521423)
I maintained chrono for about half a decade, and the specific reason I took on maintenance was because the API sucked and I hoped I could make it better.
Turns out, the reason people wanted to use it was because the API was stable and every slight step towards improvement was met with... resistance. I stopped maintaining it because the burnout from seeing what it could be and not seeing any path to get there was too much for me.
I'm extremely grateful to burntsushi for writing the datetime library rust deserves. Chrono is stable and is maintained (though semi-deprecated) by an extremely reliable rustacean -- you don't need to leave, but you'll probably be happier if you do.
Re:Jiff 1.0: A datetime library for Rust
by lifthrasiir on Monday November 16, 2026 @03:02PM
(#50522354)
As the original author of Chrono, thank you so much for your service. It was always a learning experience for me to design and maintain Chrono (that's why the API is not very good, despite my best efforts) and I too had been burnt out from doing so, so it was fortunate that the right people stepped up and kept the torch burning for so long time.
Re:Jiff 1.0: A datetime library for Rust
by the__alchemist on Monday November 16, 2026 @04:46PM
(#50523762)
Thanks to you both. I am giving benefit of doubt to those saying Jiff is even better, and I am trying Jiff today, but make no mistake: Chrono is by far, the best datetime library I've used. If Jiff ends up being people's #1, I hope they realize that Chrono is probably the #2 of any datetime library in existance. Thank you so much. It is dramatically better than Python's and JS's (official and unofficial) ones. I can rely on it for std and embedded tasks, and trust it to act as I expect.
Re:Jiff 1.0: A datetime library for Rust
by the__alchemist on Monday November 16, 2026 @06:43PM
(#50525231)
Arrow has no date type. No time type either! Using their recommended approach of "use datetimes for everything" is a poor representation of data in many scenarios and leads to surprise behavior. Chrono's sins, as enumerated in the Jiff documents, aren't on the same tier.
Unless you're talking about Arrow, the Apache Parquet interface library in either Python or Rust - that's a different matter; great software!
Re:Jiff 1.0: A datetime library for Rust
by BrandoElFollito on Tuesday November 17, 2026 @04:47AM
(#50529386)
I am trying to find a case where a time without a date would be useful. The only one I can think about are analog monotonic clocks.
In any other case I can think of, you need to attach the time to a date and a timezone. You can display it bare in the context of the viewer (who has an implicit or explicit timezone and time reference) but any manipulation without these will not end well.
Would you have some examples for the poor representation of data and surprise behaviour?
Re:Jiff 1.0: A datetime library for Rust
by the__alchemist on Tuesday November 17, 2026 @07:14AM
(#50530375)
What datetime is your birthday? What time is your Monday alarm clock set for?
There are so many, and sometimes Arrow/Moment's abstraction is OK. Other times it's awkward as it overconstrains. Sometimes it has surprising behavior.
Re:Jiff 1.0: A datetime library for Rust
by quodlibetor on Monday November 16, 2026 @06:33PM
(#50525142)
I shouldn't have used the word sucked -- personal jargon that I use all the time to describe my own code and try not to apply to other people's -- it was created pre-1.0 and we learned a lot as a community in the 10 years you spent building it.
Thank you so much for building something that was obviously good enough to sustain the community for 12 years <3
Re:Jiff 1.0: A datetime library for Rust
by hermitdev on Monday November 16, 2026 @06:49PM
(#50525292)
As someone who has worked with implementing date/time functionality before, I'm empathize. Getting APIs "right" is hard, and getting it wrong is easy because there's so many ways to get it wrong. Especially when you start getting into something like handling something like daylight saving time, which is inherently political and changes arbitrarily over time. I've spent most of my career in finance. I distinctly remember near shouting matches over what it meant to add "1 day" to a datetime. Does it mean adding 24 hours? Or, does it mean give me the same time of day tomorrow? What happens if tomorrow is the other side of a DST change? These seems like trivial questions, but matter if you're talking about, say physical delivery of oil or gas at a set rate per hour.
Re:Jiff 1.0: A datetime library for Rust
by masklinn on Tuesday November 17, 2026 @04:37AM
(#50529329)
Honestly it’s the best case of having called something shit code, it means you’ve improved enough to recognise its faults, and at most you’re hurting your own feelings and nobody else’s.
Re:Jiff 1.0: A datetime library for Rust
by lifthrasiir on Monday November 16, 2026 @07:43PM
(#50525841)
I'm fine, actually. There is a joke that every successful programming language creator would spend next decades fixing faults in one's language. I feel that applies to every successful software as well...
Re:Jiff 1.0: A datetime library for Rust
by Arch485 on Monday November 16, 2026 @03:57PM
(#50523149)
I'm really curious - what makes you say chrono's API sucks?
I've used it in several projects, and to me it seems just fine. Granted, I don't do a lot of cross-time zone work; I exclusively use UTC whenever possible.
Re:Jiff 1.0: A datetime library for Rust
by lifthrasiir on Monday November 16, 2026 @06:07PM
(#50524869)
A commonly cited reason is that it mixes Option<T> and Result<T, E> for error handling. It was designed well before Rust's API convention is settled, and I also wrongly assumed that some features like procedural macros would be delivered soon (which was why `ymd` and such panic on error).
Re:Jiff 1.0: A datetime library for Rust
by n923263 on Tuesday November 17, 2026 @03:21PM
(#50537621)
> You can say "just maintain the older versions too", and that would be absolutely great, if anyone really did this. In practice anything but the most recent major is neglected.
The implication is that you should maintain the old version, if you're still using it. (And if no one is using it, who cares?)
> Improvements that need breaking changes should happen under a new name, with a new project, so that the old project can still exist and receive updates.
And then no one really maintains old projects, either.
Fundamentally, the only difference between "libfoo-1,libfoo-2" and "libfoo,libbar" is that the latter causes more namespace pollution and makes it harder to figure out which successor projects are at least trying to maintain the overall design goals of the previous version.
Re:Jiff 1.0: A datetime library for Rust
by arjie on Monday November 16, 2026 @05:24PM
(#50524290)
My favourite part about BurntSushi software was that the structure of the program was enough that even a novice at the language could change things. Very well laid out. I had a fork of many of his applications for personal use and it was always trivial to jump in and edit. Excellent stuff.
> Jiff is pronounced like “gif” with a soft “g,” as in “gem.”
This is classic anti-trust monopoly leveraging. Lucky I'm on this side of the debate :)
Re:Jiff 1.0: A datetime library for Rust
by i2talics on Monday November 16, 2026 @05:43PM
(#50524540)
IME time is one of those things that a lot of developers try to wish away the complexity. The hard part is defining what you even mean by time, but if nobody asks the question then you don't have to provide an answer.
Strings are also similarly gnarly topic that I find a lot of devs try to ignore.
Re:Jiff 1.0: A datetime library for Rust
by dizzant on Monday November 16, 2026 @06:41PM
(#50525211)
> Jiff is pronounced like “gif” with a soft “g,” as in “gem.”
A masterclass in viral outrage bait. Not a Rustacean, I clicked the link exclusively for this nugget and will probably tell my Rust-loving colleagues about it tomorrow.
For the record, I like the converse better:
> Jiff is pronounced with a hard “g”, as in “gif”.
Re:Jiff 1.0: A datetime library for Rust
by burntsushi on Monday November 16, 2026 @07:48PM
(#50525885)
IANA time zone identifiers are baked into RFC 9557, which extends RFC 3339. For sure, IANA identifiers are generally for programmers.
> The second problem is the fact that the timezone definitions change according to the actual rules in effect in history. This is sometimes not what you want. Indeed I notice that sometimes all date libraries use the proleptic Gregorian calendar meaning our current calendar system extended backwards; no library that I know of automatically switches to Julian calendars before the cutoff. Why this inconsistency? I’d argue that when most humans express a zoned time they expect the current rules to be extended backwards. People forget the daylight saving rules change in the 2000s when talking about times before that change and expect the current rules.
Good question. One part of this answer is that the IANA tzdb does not only contain daylight saving time transitions. It also includes transitions from one offset to another, perhaps because daylight saving time was stopped or started. The other part of this answer is, I would guess, more pragmatic. Namely, we have structured data delineating time zone transitions back at least a century. If you go far enough back, then indeed, time zone transitions stop happening. We, however, do not, as far as I'm aware, have shared structured data delineating changes in calendar. This would also need to be organized by both location and time. For example, the Julian calendar was not dropped in favor of the Gregorian instantaneously everywhere. Some countries, like Russia, continued using the Julian calendar into the 20th century.
Re:Jiff 1.0: A datetime library for Rust
by masklinn on Tuesday November 17, 2026 @12:00PM
(#50534436)
> For example, the Julian calendar was not dropped in favor of the Gregorian instantaneously everywhere. Some countries, like Russia, continued using the Julian calendar into the 20th century.
An other fun one is that some of the transition schemes were... imaginative, let's say. Famously Sweden didn't want a hard break so in 1699 they decided that they would just skip leap days until they were on Gregorian. So they skipped the one in 1700, then promptly forgot the 1704 and 1708 ones because they were busy with the Great Northern War, as a result the scheme was cancelled by reverting to the Julian calendar, which they did by adding a second leap day in 1712 (which thus had a February 30th, and 367 days). Sweden ended up doing the switch at once in 1753.
That's calendaring rather than timezoning tho. Timezones really only became a factor once timekeeping was precise enough and times had to be communicated and synchronised across vast distances, which really came about with the railways (first formal "time zone" was the Railway Time of England's Great Western Railway). Before that, cities and villages oft had their individual time based on apparent solar time at the location (aka a sundial). For instance Paris Mean Time was 9 minutes and 21 seconds ahead of London.
Re:Jiff 1.0: A datetime library for Rust
by kccqzy on Tuesday November 17, 2026 @01:51PM
(#50536319)
After some more thought, I agree this should be a separate library. I did some search, and I found that ICU library seems to contain all the timezones in the world and their display names. https://cldr.unicode.org/translation/time-zones-and-city-nam...
I found the icu::TimeZoneNames class. The docstring even describes my exact problem:
> For example, people in the United States refer the zone used by the east part of North America as "Eastern Time". The tz database contains multiple time zones "America/New_York", "America/Detroit", "America/Montreal" and some others that belong to "Eastern Time". However, assigning different display names to these time zones does not make much sense for most of people.
Re:Jiff 1.0: A datetime library for Rust
by kodebach on Monday November 16, 2026 @08:02PM
(#50526022)
Always fascinating how some languages still struggle with datetime stuff, when Java (or the JVM in general) basically solved it over a decade ago. And I say "solved" because everything seems to eventually settle on the same API as java.time.
Re:Jiff 1.0: A datetime library for Rust
by Sytten on Tuesday November 17, 2026 @12:12AM
(#50527709)
I did the chrono 0.1 -> time 0.3 -> chrono 0.4 dance, hopefully jiff is the last. I need to add support for it in diesel if not already. Pretty sure we have corners of llrt where we still use chrono.
Re:Jiff 1.0: A datetime library for Rust
by masklinn on Tuesday November 17, 2026 @04:42AM
(#50529360)
There’s a jiff-diesel, but in burntsushi’s own words
> Yeah I had a really hard time making the jiff-diesel and jiff-sqlx crates. Part of the problem is the very poor datetime support in the underlying databases. The other part of the problem is that I'm not a user of either diesel or sqlx, so there are some unknown unknowns for me.
Re:Jiff 1.0: A datetime library for Rust
by Sebb767 on Tuesday November 17, 2026 @01:44AM
(#50528214)
From [0]:
> Unlike “Comparison with other Rust datetime crates,” this document is opinionated.
> [...]
> Jiff is pronounced like “gif” with a soft “g,” as in “gem.”
Burntsushi really did not hold back with this document being opinionated :-) (Though they are right, of course).
Re:Jiff 1.0: A datetime library for Rust
by tadhunt on Wednesday November 18, 2026 @04:31AM
(#50544013)
With a chance it'll be helpful to Golang devs https://github.com/tadhunt/datetime makes similar decisions as Jiff, but goes a bit further to also handle times lacking precision (missing year, month and TOD known, DOM not, etc).
AI wrote it under my strict design parameters. We use it in production in a high volume event production company, PRs welcome!
Thank you for your work on this burntsushi!
In the very early Go days (<0.9) he responded to a comment of mine going into why Go was worth looking into, quite passionately and enthusiastically which set me off on learning it and where it could be applied and that changed the kinds of roles I went after.
Ever since it's a bright little nugget whenever I see his name pop up and have tried to follow his work ever since.
Woah now, let's not get too controversial.
Graphics Interchange Format. Guh-raphics. GIF
Documentation certainly has nothing to do with it.
Other factors you mentioned are more convincing.
Never have experienced this once while using a Rust library. They are all using rustdoc hosted on docs.rs (or locally with $ cargo doc). They all look identical and there's a single global search bar that searches all your dependencies.
> conflicting dependencies
Since you can install two different versions of the same library, this is only an issue if two of your dependencies both expose a transitive dependency with different versions in their external APIs. (E.g. libA returns a Foo 1.0 and libB expects an argument of Foo 2.0) Only library I have ever run into this with is raw-window-handle.
> supply chain risks
> enormous .cargo
These I agree with. Although honestly the supply chain risk is not as big with these foundational libraries as it would first appear, since they are almost all maintained by the same 5 rust compiler developers. Really the only difference is that they're not in the rust-lang github organization and not shipped precompiled with the standard library
Not at all. We just want to avoid having the standard library be "where code goes to die", as Python folks have put it.
We're working on adding more popular APIs from the ecosystem to the standard library. See https://github.com/rust-lang/std-replacement-data/ for a data set tracking what crates have been obsoleted by additions to the standard library; we hope to increase that over time.
For a systems programming language, Rust is relatively easy to write applications in -- but I suspect standard library choices (and other choices) will be driven by the systems side for the foreseeable future.
The alternative is to keep a relatively small standard library, and a good package manager, to make it easier for people to iterate on API design in third party packages. Major version changes in a single library can have much less impact accross the ecosystem than standard library packages. Eventually you may get a de facto standard, and sometimes they are then later incorporated into the standard library.
This model isn't without its downsides; it can sometimes mean fragmentation when standardization would help, sometimes these de facto standard libraries can become important enough that they run into the same ecosystem fragmentation issues on major releases. But it allows for more flexibility.
The latter model is what the Rust project decided on for everything outside of the most fundamental time types. Dates and times and timezones are notoriously hard to model in code, and easy to create API designs that are full of footguns, so this is a place where that extra freedom to iterate was more important than standardizing on an API early on.
That iteration has led to a number of different libraries, including time, chrono, and now jiff, allowing for exploring the space of API design to really get it right rather than being stuck with what was available early on.
> Jiff is pronounced like “gif”
This would have been a hilarious line if he left off the second part!
Giraffical Interchange Format.
I found switching to Jiff from Chrono quite easy.
Hopefully Safari will soon have temporal implemented and we can leave that behind (it's in 27.3b so not out of the question).
> Chrono actually is comparatively nice
burntsushi has written pretty extensively about:
1. comparisons to existing datetime libraries (https://docs.rs/jiff/latest/jiff/_documentation/comparison/i...), chrono's original author also commented (https://github.com/BurntSushi/jiff/issues/63)
2. why they felt it was a good idea to write a new library (https://docs.rs/jiff/latest/jiff/_documentation/design/index...)
3. why they didn't wish to contribute to either chrono or time (https://docs.rs/jiff/latest/jiff/_documentation/design/index...)
And as randomblock linked, chrono is deprecating itself.
This is still very surprising given the context; if the top datetime library of any language is getting soft-replaced with something nicer, woe be to those in other languages!
Time is such a pain, I write code for simulating orbits of asteroids/stuff in the solar system, and time and time conversions play a major roll in it. I often need accuracy at the mega-year to giga-year scales, but also sometimes micro-second relative.
I saw on this page that you at least mention TAI time, how are you handling time scales in general? Like would it be hard to add some other timescales like UT1?
Right now I have to do all of this manually and I have been using chrono as just a convenience wrapper so that my users can convert ISO time strings into my internal representation.
Edit: Oh no! I just found out chrono is being semi-deprecated, looks like I'm going to be switching...
Ah yeah hifitime, I tried it out but its internal representation doesn't work well for my long term simulations, the integer representation ends up increasing the numerical noise in my simulations when I do really sensitive long term ones.
[1] https://docs.rs/jiff-tzdb/latest/jiff_tzdb/#data-generation
[2] https://github.com/BurntSushi/jiff/issues/278
[3] https://github.com/BurntSushi/jiff/issues/279
The C++ date-time library goes and loads the system copy of ICU (which is updated via windows update) and pulls the tz data from ICU's calendar api.
I really appreciate when a project calmly acknowledges that it's not the right tool for every use case, and is not trying to be. That's professional engineering.
Especially in the AI-age, the crucial skill will be what NOT to implement.
Outside of this not using a timer library is going for a world of pain
Turns out, the reason people wanted to use it was because the API was stable and every slight step towards improvement was met with... resistance. I stopped maintaining it because the burnout from seeing what it could be and not seeing any path to get there was too much for me.
I'm extremely grateful to burntsushi for writing the datetime library rust deserves. Chrono is stable and is maintained (though semi-deprecated) by an extremely reliable rustacean -- you don't need to leave, but you'll probably be happier if you do.
Unless you're talking about Arrow, the Apache Parquet interface library in either Python or Rust - that's a different matter; great software!
In any other case I can think of, you need to attach the time to a date and a timezone. You can display it bare in the context of the viewer (who has an implicit or explicit timezone and time reference) but any manipulation without these will not end well.
Would you have some examples for the poor representation of data and surprise behaviour?
There are so many, and sometimes Arrow/Moment's abstraction is OK. Other times it's awkward as it overconstrains. Sometimes it has surprising behavior.
Doesn't that belong to a scheduler library?
Thank you so much for building something that was obviously good enough to sustain the community for 12 years <3
I've used it in several projects, and to me it seems just fine. Granted, I don't do a lot of cross-time zone work; I exclusively use UTC whenever possible.
The implication is that you should maintain the old version, if you're still using it. (And if no one is using it, who cares?)
> Improvements that need breaking changes should happen under a new name, with a new project, so that the old project can still exist and receive updates.
And then no one really maintains old projects, either.
Fundamentally, the only difference between "libfoo-1,libfoo-2" and "libfoo,libbar" is that the latter causes more namespace pollution and makes it harder to figure out which successor projects are at least trying to maintain the overall design goals of the previous version.
> Jiff is pronounced like “gif” with a soft “g,” as in “gem.”
This is classic anti-trust monopoly leveraging. Lucky I'm on this side of the debate :)
Strings are also similarly gnarly topic that I find a lot of devs try to ignore.
A masterclass in viral outrage bait. Not a Rustacean, I clicked the link exclusively for this nugget and will probably tell my Rust-loving colleagues about it tomorrow.
For the record, I like the converse better:
> Jiff is pronounced with a hard “g”, as in “gif”.
> The second problem is the fact that the timezone definitions change according to the actual rules in effect in history. This is sometimes not what you want. Indeed I notice that sometimes all date libraries use the proleptic Gregorian calendar meaning our current calendar system extended backwards; no library that I know of automatically switches to Julian calendars before the cutoff. Why this inconsistency? I’d argue that when most humans express a zoned time they expect the current rules to be extended backwards. People forget the daylight saving rules change in the 2000s when talking about times before that change and expect the current rules.
Good question. One part of this answer is that the IANA tzdb does not only contain daylight saving time transitions. It also includes transitions from one offset to another, perhaps because daylight saving time was stopped or started. The other part of this answer is, I would guess, more pragmatic. Namely, we have structured data delineating time zone transitions back at least a century. If you go far enough back, then indeed, time zone transitions stop happening. We, however, do not, as far as I'm aware, have shared structured data delineating changes in calendar. This would also need to be organized by both location and time. For example, the Julian calendar was not dropped in favor of the Gregorian instantaneously everywhere. Some countries, like Russia, continued using the Julian calendar into the 20th century.
An other fun one is that some of the transition schemes were... imaginative, let's say. Famously Sweden didn't want a hard break so in 1699 they decided that they would just skip leap days until they were on Gregorian. So they skipped the one in 1700, then promptly forgot the 1704 and 1708 ones because they were busy with the Great Northern War, as a result the scheme was cancelled by reverting to the Julian calendar, which they did by adding a second leap day in 1712 (which thus had a February 30th, and 367 days). Sweden ended up doing the switch at once in 1753.
That's calendaring rather than timezoning tho. Timezones really only became a factor once timekeeping was precise enough and times had to be communicated and synchronised across vast distances, which really came about with the railways (first formal "time zone" was the Railway Time of England's Great Western Railway). Before that, cities and villages oft had their individual time based on apparent solar time at the location (aka a sundial). For instance Paris Mean Time was 9 minutes and 21 seconds ahead of London.
While not necessarily wrong, it should probably be a separate library entirely: there are projects maintaining GIS boundaries for the IANA timezones.
I found the icu::TimeZoneNames class. The docstring even describes my exact problem:
> For example, people in the United States refer the zone used by the east part of North America as "Eastern Time". The tz database contains multiple time zones "America/New_York", "America/Detroit", "America/Montreal" and some others that belong to "Eastern Time". However, assigning different display names to these time zones does not make much sense for most of people.
I then looked at the icu::TimeZoneNames::find member function and it seemed to do exactly what I proposed. https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/clas... Except it’s marked as internal use only. I don’t know what’s going on.
What a cardinal sin! Instantly distrust this project.
(I'm kidding, Andrew. But this is clearly the wrong pronunciation! :P)
I really, really, hate Monday
> Yeah I had a really hard time making the jiff-diesel and jiff-sqlx crates. Part of the problem is the very poor datetime support in the underlying databases. The other part of the problem is that I'm not a user of either diesel or sqlx, so there are some unknown unknowns for me.
https://www.reddit.com/r/rust/comments/1xx7v4v/comment/19sp2...
So I’m sure they’d be glad for assistance.
> Unlike “Comparison with other Rust datetime crates,” this document is opinionated. > [...] > Jiff is pronounced like “gif” with a soft “g,” as in “gem.”
Burntsushi really did not hold back with this document being opinionated :-) (Though they are right, of course).
[0] https://docs.rs/jiff/latest/jiff/_documentation/design/index...
Do you seasoned rustaceans may explain why we don’t have such a standard library?
It’s a genuine question from an ignorant :)
Just look at the original java time stuff Vs those that came in java 8.
And once something is in the standard library it can never change.
https://youtu.be/-5wpm-gesOY?is=uTBX7FlDPNaUt7oC
AI wrote it under my strict design parameters. We use it in production in a high volume event production company, PRs welcome!