# m3e/ymd

# Types

## Ymd

opaque </>

Ymd is a date only consisting of year, month, and day.

    pub opaque type Ymd

# Values

## default

</>

    pub const default: Ymd

## from_string

</>

    pub fn from_string(input: String) -> Result(Ymd, String)

from_string parses a Ymd value from a string, returning a Result. The string must be in the format yyyy-mm-dd, with valid year, month, and day values.

## new

</>

    pub fn new(
      year: Int,
      month: Int,
      day: Int,
    ) -> Result(Ymd, String)

new creates a Ymd value from year, month, and day integers, returning a Result. The year must be between 1800 and 2500, inclusive. The month must be between 1 and 12, inclusive. The day must be between 1 and the number of days in the given month and year, inclusive.

## to_string

</>

    pub fn to_string(d: Ymd) -> String

to_string converts a Ymd value to a string in the format yyyy-mm-dd.

## today_utc

</>

    pub fn today_utc() -> Ymd

today_utc creates a Ymd (pure year-month-day) with today’s date

✨