Skip to content

Quick start

Pick your language. The tab you choose here is remembered on every page with the same tabs.

Terminal window
cargo add nepdate@=0.1.0-beta.1

The core has no dependencies and no almanac data. Add the patro package later if you need tithi, holidays or events (Core and patro). C# NepDate is one package with both.

Each snippet turns BS 2081-04-15 into AD 2024-07-30 and writes it the long way, Shrawan 15, 2081.

use nepdate::{Lang, LongDate, NepaliDate};
let date = NepaliDate::new(2081, 4, 15)?;
let ad = date.to_gregorian();
assert_eq!((ad.year(), ad.month(), ad.day()), (2024, 7, 30));
println!("{}", date.long(LongDate::default(), Lang::En)); // Shrawan 15, 2081

Each language page has the full install, formatting and parsing in that language’s style, and the patro:

The behaviour behind every port is described once: