Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How To Get Current Date  RSS feed

 
kiran mohan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai guys i have a problem ingetting current SystemDate and change its format to yyyyMMdd , can any help out..!



ThankYou
MohanKiran
 
Nick Gusev
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd ");
String result = sdf.format(System.currentTimeMillis());
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get the current date, simply instantiate a new date:

take a look at java.text.SimpleDateFormat to format the date the way you want to.
 
Richard Anderson
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at java.text.DateFormat.

DateFormat
 
kiran mohan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Nick , Joel and Richard for ur help, i am well out of the problem with ur help.
Bye
With Regards
MohanKiran
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!