Timelib for Rust is a small Rust wrapper around the timelib library that is used to power PHP and MongoDB.
Prerequisites:
timelib
depends on re2c
to be built. You can install it easily on all major platforms:
apt-get install re2c
brew install re2c
choco install re2c
Now you can install with:
bash
cargo add timelib
```rust strtotime("tomorrow".into(), None, None);
strtotime("next tuesday".into(), Some(1654318823), Some("America/Chicago".into())); ```
View the tests for more examples.
Make sure to check out all submodules.
Initial clone:
bash
git clone --recurse-submodules https://github.com/westy92/timelib-rust
Post-clone:
bash
git submodule init && git submodule update
Make sure to install re2c
as described above.
You should now be able to run cargo build
and cargo test
.