Refactoring on DateChangeTime function.