Human-friendly date and time utilities for Mojo. Morrow provides an Arrow-inspired API for creating, parsing, formatting, shifting, comparing, and humanizing date-time values.
Language: English | 䏿–‡
Documentation: https://mojoto.github.io/morrow.mojo/
Add the Modular and Modular Community channels to your Pixi workspace, then install Morrow:
pixi workspace channel add --prepend https://repo.prefix.dev/modular-community
pixi workspace channel add --prepend https://repo.prefix.dev/max
pixi add morrowThe package installs a compiler-compatible morrow.mojoc into the active Pixi
environment, so it can be imported without copying source files.
To work from a source checkout, install uv and run:
make installmake install creates or reuses .venv with Python 3.14, installs the pinned
Mojo version, and prints it. All Mojo targets in the Makefile run through
uv run mojo.
Start the Mojo REPL from the project root to use the source package directly:
uv run mojo replPaste the following example into the REPL:
from morrow import FORMAT_RSS, Morrow, TimeZone
var now = Morrow.now()
print(now)
var utc = Morrow.utcnow()
print(utc)
var parsed = Morrow.get("2026-01-01 03:04:05Z")
print(parsed)
print(parsed.format("YYYY-MM-DD HH:mm:ss ZZ"))
var beijing = parsed.to("+08:00")
print(beijing)
var hour = beijing.span("hour")
print(hour)
print(beijing.isocalendar())
print(beijing.timetuple())
var rss = Morrow(2026, 1, 1, 10, 30, 35, 0, TimeZone(0, "UTC"))
print(rss.format(FORMAT_RSS))Morrow is UTC by default, supports fixed-offset time zones, parses ISO 8601
strings and POSIX timestamps, and formats values with Arrow-style tokens or
Python-style strftime.
Copy the morrow source directory into your project, or build a precompiled
package:
make buildThis creates morrow.mojoc. Precompiled Mojo packages are tied to the compiler
version that created them, so use the same Mojo version when importing one.
Matching artifacts may also be available from
releases.
Run make help to list the available targets.
| Target | Description |
|---|---|
make install |
Create or reuse .venv and install Mojo with uv (prereleases allowed) |
make test |
Run every tests/test_*.mojo file |
make format |
Format the morrow and tests directories |
make build |
Precompile morrow as morrow.mojoc |
make package |
Build the distributable Conda package with rattler-build |
make clean |
Remove morrow.mojoc |
make doc-install |
Install Docusaurus dependencies |
make doc-build |
Build the Docusaurus static site |
make doc-serve |
Serve the built Docusaurus site |
make doc-clean |
Remove generated Docusaurus files |
The documentation targets require Node.js and npm. Run make doc-install before
building the documentation, then use make doc-build followed by
make doc-serve to preview the built site.