XmlPeriod

class xsdata.models.datatype.XmlPeriod(value)[source]

Concrete xs:gYear/Month/Day builtin type.

Represents iso 8601 period formats with rich comparisons and hashing.

Formats:
  • xs:gDay: —%d%z

  • xs:gMonth: –%m%z

  • xs:gYear: %Y%z

  • xs:gMonthDay: –%m-%d%z

  • xs:gYearMonth: %Y-%m%z

Parameters

value (str) – String representation of a xs:period, eg –11-01Z

property year

Period year.

Return type

Optional[int]

property month

Period month.

Return type

Optional[int]

property day

Period day.

Return type

Optional[int]

property offset

Period timezone offset in minutes.

Return type

Optional[int]

as_dict()[source]

Return date units as dict.

Return type

Dict

__eq__(other)[source]

Return self==value.

Parameters

other (Any) –

Return type

bool