Crates.io | adtobs |
lib.rs | adtobs |
version | 0.1.2 |
source | src |
created_at | 2023-11-29 05:49:49.172643 |
updated_at | 2024-03-07 18:06:14.928706 |
description | A Rust crate for effortless conversion of dates between the Gregorian (English) calendar and the Nepali calendar (Bikram Sambat). |
homepage | https://github.com/amrit073/adtobs-rs |
repository | https://github.com/amrit073/adtobs-rs |
max_upload_size | |
id | 1052651 |
size | 50,385 |
A Rust crate for converting dates from the Gregorian calendar to the Nepali calendar (Bikram Sambat).
get_todays_np_date
: Get today's date in the Nepali calendar.convert_ad_to_bs
: Convert a Gregorian (English) date to a Nepali date.convert_utc_to_bs
: Convert a UTC date string to a Nepali date.Add this crate to your Cargo.toml
:
[dependencies]
adtobs = "0.1.0"
use adtobs::get_todays_np_date;
let nepali_date = get_todays_np_date();
println!("Today's Nepali Date: {}", nepali_date);
use adtobs::convert_ad_to_bs;
let nepali_date = convert_ad_to_bs(2023, 11, 29);
println!("Nepali Date: {}", nepali_date);
use adtobs::convert_utc_to_bs;
let utc_date = "2023-11-29T12:00:00Z";
let nepali_date = convert_utc_to_bs(utc_date);
println!("Nepali Date: {}", nepali_date);
This project is licensed under the GNU General Public License v3.0