Realize there are three separate things you have to master in your problem:
1. Getting the current date and time
2. Formatting that are you wish it to appear
3. GUI issues: responding to a button click and displaying a string. To help you with this, you have to be clearer about your program. AWT? Swing? SWT? Web application?