Repository navigation
Morrow 1.1
Version 1.1 is additive. Documented 1.0 behavior is unchanged, including English and Chinese output.
81 languages
- Formatting, parsing,
humanizeanddehumanizesupport 81 built-in locales. Apart from Simplified and Traditional Chinese, which keep their 1.0 text, the output matches Arrow 1.4.0. - The new
Localetype can be loaded once and reused in loops, or edited to define a custom locale. - Locale names ignore case and accept
_or-, sopt_BR,pt-brandPT-BRselect the same locale. dehumanizereadshumanizetext in every locale, including 18 that Arrow does not support, such as Arabic, Hebrew, Korean and Thai.- Thai and Lao dates format and parse Buddhist-era years.
- See the locales guide for the full list, customization and the documented differences from Arrow.
var dt = Morrow(2026, 1, 1, 15)
print(dt.format("dddd Do MMMM YYYY", locale="fr")) # jeudi 1er janvier 2026
print(dt.shift(hours=-5).humanize(dt, locale="ru")) # 5 часов назадTimezones read tzdata directly, about 78× faster
- Named and local timezones are read from the system tzdata in pure Mojo.
- Each zone file is parsed once per process and shared, so a conversion takes about 0.3 µs, down from 23 µs in 1.0. That holds when you pass a region name as well as a
TimeZone. - ICU is now only a fallback for zones without a zone file.
- Offsets, repeated times and skipped times match ICU in all 598 system zones, checked over about 1.05 million comparisons.
dst()is inferred from tzdata. It can differ from ICU in a few historical periods where the standard offset and DST changed together.
New APIs
MorrowandTimeDeltaimplementHashableandEquatable, so they work asDictkeys andSetmembers.==,!=andtoordinal()no longer raise.tz_abbreviation()returns tzdata abbreviations such asEST,EDT,CSTand+08, matching Python's zoneinfo and Arrow.tzname()still returns the region identifier.TimeDeltaadds/,//,divmod()and float scaling. Results round to the nearest microsecond, ties to even.Morrow.get()accepts aMorrowTimeTuple.
Compatibility notes
- Locale text is data. Translation fixes can change output in minor releases.
- Timezone rules follow the installed tzdata. Use the same tzdata version when you need identical rules across machines.
- Changing process timezone settings after the first named-zone lookup is not supported.
- Loading a locale by name costs about 1 µs per call. In hot loops, pass a
Localevalue instead.
Distribution and testing
- Six archives cover Mojo 1.0.0 and 1.1.0 on Linux x86-64, Linux ARM64 and macOS ARM64. Choose the archive for your compiler and platform, and verify it against
SHA256SUMS. - Every archive is extracted and tested by a consumer outside the source checkout before upload. The consumer now also covers locales, hashing and timezone abbreviations.
- The suite has 140 unit-test functions and 6,000 fixed-seed property samples.
- Coverage includes Arrow expectations for every built-in locale,
dehumanizeround trips for every unit in every locale, a tzdata-versus-ICU comparison and POSIX rule unit tests. - CI also runs 558 deterministic comparisons against Arrow 1.4.0.
See the migration guide and the stability contract.