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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//! A date and time parser independent of any Rust date and time library.
//!
//! This library can be used to parse a date and time string into a [`RawDateTime`], which the user
//! can then convert into whatever final type is needed, without taking on a larger time library as
//! a dependency.
pub use ParseError;
pub use RawDate;
pub use RawDateTime;
pub use RawTime;
/// A result returned from date and time parsing.
pub type ParseResult<T> = ;
/// A date and time parser object.
///
/// This parser is able to take a `strptime` format string and parse a string into a
/// [`RawDateTime`] struct, which the user can then use to convert into whatever format is most
/// convenient.
///
/// The following symbols are currently recognized:
///
/// ## Year
///
/// | Code | Example | Description |
/// | ---- | ------- | ------------------------------------------------------ |
/// | `Y` | `2012` | The year, zero-padded to 4 digits. |
/// | `C` | `20` | The year divided by 100, with the remainder discarded. |
/// | `y` | `12` | The year modulo 100, zero-padded to 2 digits. |
///
/// ## Month
///
/// | Code | Example | Description |
/// | ---------- | ------- | ----------------------------------------------------------------- |
/// | `m` | `04` | The month number, zero-padded to two digits (`01`` = January) |
/// | `b` or `h` | `Apr` | The month's English name, abbreviated to three characters |
/// | `B` | `April` | The month's English name (abbreviations >= 3 chars also accepted) |
///
/// ## Day
///
/// | Code | Example | Description |
/// | ---- | ------- | ---------------------------------------------- |
/// | `d` | `21` | The day of the month, zero padded to 2 digits. |
/// | `e` | `21` | Same as `% d`. |
///
/// ## Weekday
///
/// | Code | Example | Description |
/// | ---- | -------- | ----------------------------------------------------- |
/// | `a` | `Sun` | The English weekday, abbreviated to three characters. |
/// | `A` | `Sunday` | The English weekday (full name). |
///
/// ## Hour
///
/// | Code | Example | Description |
/// | ---- | ------- | ----------------------------------------------------------- |
/// | `H` | `17` | The hour, zero-padded to 2 digits, using the 24-hour clock. |
/// | `I` | `05` | The hour, zero-padded to 2 digits, using the 12-hour clock. |
/// | `k` | `17` | Same as `% H`. |
/// | `p` | `PM` | `AM` or `PM` |
/// | `P` | `pm` | `am` or `PM` |
///
/// ## Minute
///
/// | Code | Example | Description |
/// | ---- | ------- | ------------------------------------ |
/// | `M` | `30` | The minute, zero-padded to 2 digits. |
///
/// ## Second
///
/// | Code | Example | Description |
/// | ---- | ------- | ------------------------------------ |
/// | `S` | `45` | The second, zero-padded to 2 digits. |
///
/// ## Nanosecond
///
/// | Code | Example | Description |
/// | ---- | ----------- | ---------------------------------------- |
/// | `f` | `500000000` | The nanosecond, zero-padded to 9 digits. |
///
/// ## Time Zone Offset
///
/// | Code | Example | Description |
/// | ---- | ------- | -------------------------------- |
/// | `z` | `-0400` | The offset, as `MMSS`, from UTC. |
///
/// **Note:** The parser does not currently check for certain impossible combinations (such as
/// declaring that April 21, 2012 was a Tuesday, when it was actually a Saturday). Currently,
/// non-conclusive input (such as weekdays) are discarded. This will change in the future.
/// Options for date and time parsing.
pub