Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date & Time

 
Mathavan Balakrishnan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
I want to know how to get the system date and time.
Can u tell me the method and class used for that ?
Waiting for ur reply.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at classes like GregorianCalendar and Calendar.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If you want the output in a specific format, have a look at class java.text.SimpleDateFormat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic