Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Date problem  RSS feed

 
Dhiraj Srivastava
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display only the current date in a text field can any one please help me
Thanks in advance
Dhiraj
 
Fred Abbot
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.currentTimeMillis()
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or try this (or something like this) for outputting a formatted date:

SimpleDateFormat sdf = new SimpleDateFormat();
String daytime = sdf.format(new Date(System.currentTimeMillis()));
System.out.println(daytime);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!