Functions for clock setting