phenopacket_mapper.data_standards.date module
- class phenopacket_mapper.data_standards.date.Date(year: int = 0, month: int = 0, day: int = 0, hour: int = 0, minute: int = 0, second: int = 0)[source]
Bases:
object
Data class for Date
- iso_8601_datestring() str [source]
Returns the date in ISO 8601 format
Example: “2021-06-02T16:52:15Z” Format: “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” Definition: The format for this is “{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z” where {year} is
always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The “Z” suffix indicates the timezone (“UTC”); the timezone is required.
- formatted_string(fmt: str) str [source]
Returns the date in the specified format
- Parameters:
fmt – the format as a string to return the date in
- Returns:
the date in the specified format