git_date/
lib.rs

1//! Date and time parsing similar to what git can do.
2//!
3//! Note that this is not a general purpose time library.
4//! ## Feature Flags
5#![cfg_attr(
6    feature = "document-features",
7    cfg_attr(doc, doc = ::document_features::document_features!())
8)]
9#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
10#![deny(missing_docs, rust_2018_idioms)]
11#![forbid(unsafe_code)]
12
13///
14pub mod time;
15
16///
17pub mod parse;
18pub use parse::function::parse;
19
20/// A timestamp with timezone.
21#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
22#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
23pub struct Time {
24    /// time in seconds since epoch.
25    pub seconds_since_unix_epoch: u32,
26    /// time offset in seconds, may be negative to match the `sign` field.
27    pub offset_in_seconds: i32,
28    /// the sign of `offset`, used to encode `-0000` which would otherwise loose sign information.
29    pub sign: time::Sign,
30}