Skip to content

Commit

Permalink
[MICRO] Fix date default (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
faph authored Nov 16, 2023
2 parents ac2521b + f676c12 commit f4bb95a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/py_avro_schema/_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def data(self, names: NamesType) -> JSONObj:

def make_default(self, py_default: datetime.date) -> int:
"""Return an Avro schema compliant default value for a given Python value"""
return (py_default - datetime.date.fromtimestamp(0)).days
return (py_default - datetime.date(1970, 1, 1)).days


class TimeSchema(Schema):
Expand Down

0 comments on commit f4bb95a

Please sign in to comment.