changed date format logic