This will work,you can use the System.currentTimeMilliSeconds() method(exact method name you can search) and extract the last 4 digits dd-mm-yy format or 6 digits for dd-mm-yyyy and get your month and year ,if there is an ui selection from the front end for date then your process will work and where you are putting it too