1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Date and time parsing similar to what git can do.
//!
//! Note that this is not a general purpose time library.
//!
//! ## Examples
//!
//! ```
//! use gix_date::{
//! parse,
//! parse_header,
//! time::{format, Format},
//! };
//!
//! let time = parse("Thu, 18 Aug 2022 12:45:06 +0800", None).unwrap();
//! assert_eq!(time.offset, 8 * 60 * 60);
//! assert_eq!(time.format(Format::Raw).unwrap(), "1660797906 +0800");
//! assert_eq!(time.format(Format::Custom(format::ISO8601)).unwrap(), "2022-08-18 12:45:06 +0800");
//!
//! let from_header = parse_header("1660797906 +0800").unwrap();
//! assert_eq!(from_header, time);
//! ```
//! ## Feature Flags
///
///
pub use ;
pub use ValidationError as Error;
/// A timestamp with timezone.
/// The number of seconds since unix epoch.
///
/// Note that negative dates represent times before the unix epoch.
///
/// ### Deviation
///
/// `git` only supports dates *from* the UNIX epoch, whereas we chose to be more flexible at the expense of stopping time
/// a few million years before the heat-death of the universe.
pub type SecondsSinceUnixEpoch = i64;
/// time offset in seconds.
pub type OffsetInSeconds = i32;