Skip to main content

bytes_as_date

Converts a byte string representing a date into a Python date object.

def bytes_as_date(
data: bytes
) - > datetime.date

Converts a byte sequence into a date object by decoding the bytes as a UTF-8 string and parsing the resulting ISO 8601 formatted date.

Parameters

NameTypeDescription
databytesThe raw byte sequence containing an ISO 8601 formatted date string to be converted.

Returns

TypeDescription
datetime.dateA date object representing the decoded and parsed calendar date.