This allows you to just call excel_date and it will convert any dates between excel and python datetime.
1 2 3 4 | def excel_date(value):
value = float(value) - 2
edate = datetime.datetime(year=1900,month=1,day=1)
return edate + datetime.timedelta(days=value)
|
More like this
- Form field with fixed value by roam 1 week, 5 days ago
- New Snippet! by Antoliny0919 2 weeks, 4 days ago
- Add Toggle Switch Widget to Django Forms by OgliariNatan 3 months, 1 week ago
- get_object_or_none by azwdevops 6 months, 4 weeks ago
- Mask sensitive data from logger by agusmakmun 8 months, 3 weeks ago
Comments
You could explain input and output values. Example?
#
Please login first before commenting.