This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use calender

 
sony vijay
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to display the current date and time inside a textbox. How do I do this? I have an instance of a zk textbox in my code:



Thanks,
Sony
 
Dinakar Kas
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calendar.getInstance().getTime() gives the date object.
 
Vinoth Kumar Kannan
Ranch Hand
Posts: 276
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively you can also use the java.util.Date class..
new java.util.Date() gives you the current date and time.
We go to Calendar class especially when we need to do some date time calculations. Nothing wrong in using it for getting the current date/time either.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic