how to store RTC time in an arduino uno board, which library should i use...?

i am unable to store time button press time in x and y variables

Using what code? Why do the names x and y mean anything to you? To me, they look like variables to hold coordinates, not times.

i want to know should i use eeprom library to store

Do you need to save the times in the event that the Arduino looses power/is reset? If not, no.

is it possible with this code only...and how...?

With what code? For how long?