get right date for comparsion