Updated the check datetime method