using class function to assign date