change datetime logic