MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / month_number

Function month_number

src/timeutil.rs:240–257  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

238}
239
240fn month_number(name: &str) -> Option<u32> {
241 let abbrev = name.get(..3)?.to_ascii_lowercase();
242 Some(match abbrev.as_str() {
243 "jan" => 1,
244 "feb" => 2,
245 "mar" => 3,
246 "apr" => 4,
247 "may" => 5,
248 "jun" => 6,
249 "jul" => 7,
250 "aug" => 8,
251 "sep" => 9,
252 "oct" => 10,
253 "nov" => 11,
254 "dec" => 12,
255 _ => return None,
256 })
257}
258
259/// Parses `(UTC)`, `(UTC+2)`, `(UTC-7)`, or `(UTC+5:30)` into offset seconds.
260fn parse_utc_offset(zone: &str) -> Option<i64> {

Callers 1

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected