How to print a selected date from the variable?