Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date problem

 
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