manage date in setup function