Module mz_repr::adt::datetime

source ·
Expand description

Date and time utilities.

Modules§

Structs§

Enums§

  • Order of definition is important for PartialOrd and Ord to be derived correctly
  • Units of measurements associated with dates and times.
  • Interval strings can be presented in one of two formats:
  • TimeStrToken represents valid tokens in time-like strings, i.e those used in INTERVAL, TIMESTAMP/TZ, DATE, and TIME.

Functions§

  • Determines the format of the interval part (uses None to identify an indeterminant/ambiguous format). This is necessary because the interval string format is not LL(1); we instead parse as few tokens as possible to generate the string’s semantics.
  • Get the expected TimeStrTokens to parse SQL Standard time-like DateTimeFields, i.e. HOUR, MINUTE, SECOND. This is used for INTERVAL, TIMESTAMP, and TIME.
  • Get the expected TimeStrTokens to parse TimePartFormat::SqlStandard parts, starting from some DateTimeField. Delim tokens are never actually included in the output, but are illustrative of what the expected input of SQL Standard interval values looks like.
  • Fills the year, month, and day fields of pdt using the TimeStrTokens in actual.
  • Fills a ParsedDateTime’s fields using the actual tokens, starting at leading_field and descending to less significant DateTimeFields.
  • Fills a ParsedDateTime’s fields for a single PostgreSQL-style interval parts, e.g. 1 month. Invoke this function once for each PostgreSQL-style interval part.
  • Fills a ParsedDateTime’s fields when encountering SQL standard-style interval parts, e.g. 1-2 for Y-M 4:5:6.7 for H:M:S.NS.
  • Fills the hour, minute, and second fields of pdt using the TimeStrTokens in actual.
  • PostgreSQL treats out-of-place colons as errant punctuation marks, and trims them.
  • Takes a ‘date timezone’ ‘date time timezone’ string and splits it into ‘date {time}’ and ‘timezone’ components
  • Convert a string from a time-like datatype (INTERVAL, TIMESTAMP/TZ, DATE, and TIME) into Vec<TimeStrToken>.