How to get current date and time upon a click