• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing date

 
Deepak Kumar Jena
Ranch Hand
Posts: 68
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
Sheriff
Pie
Posts: 49845
70
  • 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: 68
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
Bartender
Pie
Posts: 6128
74
  • 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
Sheriff
Pie
Posts: 49845
70
  • 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: 68
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all. I have done it.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49845
70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done. How did you do it?
 
Deepak Kumar Jena
Ranch Hand
Posts: 68
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic