use date class instead of time