I would separate the printing of the data from the printing of the duration and keep a prevDate variable to determine when to print the date and when not to.
I leave it to you to flesh out the rest of the program.
All things are lawful, but not all things are profitable.
Don't get me started about those stupid light bulbs.