put a stop at the point you are outputting your dates

and look at whet values you are producing

then step back and put a stop where ever you change the date stuff and look at the value there

once you have the date in the right format
then go forwards again

here to help