used Date function in CoreData