I am writing a small program that allows users to log some information, one item of such is the Time/Date that something has happened, I create the log ultimately with a button, and if the jTextField is left empty i want to add the current system time and/or date instead. I tried writing the System.currentTimeMillis() to the text field however it is of type long so not compatible, is their an easier way to do it?