To prevent bogus input data from messing up your clock we could add minimum and maximum allowed values for datetime.