Skip to main content

parse_date_string

Function parse_date_string 

Source
pub fn parse_date_string(input: &str) -> Option<i64>
Expand description

Parse a Cypher ISO-8601 date string into a NaiveDate.

Accepts every form the TCK’s date(<string>) outline exercises:

inputmeaningexample
2015-07-21calendar (extended)2015-07-21
20150721calendar (basic)2015-07-21
2015-07year-month2015-07-01
201507year-month (basic)2015-07-01
2015year only2015-01-01
2015-W30-2ISO week + weekday2015-07-21
2015W302ISO week + weekday2015-07-21
2015-W30ISO week (Monday)2015-07-20
2015W30ISO week (Monday)2015-07-20
2015-202ordinal (day of year)2015-07-21
2015202ordinal (basic)2015-07-21

Returns None for any string that is not one of these forms or that names an out-of-range date.