MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / format_date

Function format_date

src/repr/src/strconv.rs:417–428  ·  view source on GitHub ↗

Writes a [`Date`] to `buf`.

(buf: &mut F, d: Date)

Source from the content-addressed store, hash-verified

415
416/// Writes a [`Date`] to `buf`.
417pub fn format_date<F>(buf: &mut F, d: Date) -> Nestable
418where
419 F: FormatBuffer,
420{
421 let d: NaiveDate = d.into();
422 let (year_ad, year) = d.year_ce();
423 write!(buf, "{:04}-{}", year, d.format("%m-%d"));
424 if !year_ad {
425 write!(buf, " BC");
426 }
427 Nestable::Yes
428}
429
430/// Parses a `NaiveTime` from `s`, using the following grammar.
431///

Callers 4

stringify_datumFunction · 0.85
cast_date_to_stringFunction · 0.85
encode_textMethod · 0.85
run_test_format_dateFunction · 0.85

Calls

no outgoing calls

Tested by 1

run_test_format_dateFunction · 0.68