git2-time-chrono-ext 0.2.3

Rust extension library to convert `git2::Time` to `chrono`
Documentation

CI-badge crate-badge docs-badge

git2-time-chrono-ext

Rust extension library to convert git2::Time to chrono.

Install

cargo add git2-time-chrono-ext

Please see the releases for the change history.

Example

Usage

use git2_time_chrono_ext::Git2TimeChronoExt;

// Print `git2::Time` to `stdout`.
fn print_git2_time(time: git2::Time) {
  println!("{}", time.to_local_date_time().unwrap());
}

// Convert `git2::Time` to `Stirng` in the specified format.
fn git2_time_to_string(time: git2::Time) -> String {
  time.to_local_date_time().unwrap().format("%Y-%m-%d %H:%M").to_string()
}

Please see the docs.rs for more details.