• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing date  RSS feed

 
Deepak Kumar Jena
Ranch Hand
Posts: 71
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to print the date as 13 Sept 2010 using a single line of code?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Kumar Jena wrote:How to print the date as 13 Sept 2010 using a single line of code?

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne Neal wrote:
Deepak Kumar Jena wrote:How to print the date as 13 Sept 2010 using a single line of code?



I'd be surprised if that's really what he meant.
 
Campbell Ritchie
Marshal
Posts: 56223
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne! Really!

There are useful hints in the documentation for Formatter. And search the Java™ Tutorials for "formatting". If you keep going long enough, you will actually find an example for dates.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Joanne! Really!


You're right. I should only have given some hints rather than the actual code. Sorry.
 
Deepak Kumar Jena
Ranch Hand
Posts: 71
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yah Sebastian has got some idea about what I was looking for (Date Format). Thanks Ritchie for giving me the hint.
 
Stephan van Hulst
Saloon Keeper
Posts: 7932
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne Neal wrote:
Campbell Ritchie wrote:Joanne! Really!


You're right. I should only have given some hints rather than the actual code. Sorry.


 
Campbell Ritchie
Marshal
Posts: 56223
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I never said anything about DateFormat, but that will probably work too.
 
Deepak Kumar Jena
Ranch Hand
Posts: 71
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all. I have done it.
 
Campbell Ritchie
Marshal
Posts: 56223
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done. How did you do it?
 
Deepak Kumar Jena
Ranch Hand
Posts: 71
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!