Fixed datetime calculate bug.