Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting System Time and setting to jTextField

Status
Not open for further replies.

hespy

Programmer
Joined
Nov 29, 2004
Messages
14
Location
GB
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?
 
Code:
new Date().toString();
 
Thanks works wonders :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top