Fixed data type interpretation.
Fixed date calculation.
Removed unnecessary import.