wood burning stoves 2.0*
The moose likes Java in General and the fly likes Printing date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Printing date" Watch "Printing date" New topic
Author

Printing date

Deepak Kumar Jena
Ranch Hand

Joined: Sep 08, 2010
Posts: 68

How to print the date as 13 Sept 2010 using a single line of code?


dkj4jdk
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3506
    
  14
Deepak Kumar Jena wrote:How to print the date as 13 Sept 2010 using a single line of code?



Joanne
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
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.


JDBCSupport - An easy to use, light-weight JDBC framework -
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
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

Joined: Aug 05, 2005
Posts: 3506
    
  14
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

Joined: Sep 08, 2010
Posts: 68

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

Joined: Sep 20, 2010
Posts: 3617
    
  14

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

Joined: Oct 13, 2005
Posts: 38519
    
  23
I never said anything about DateFormat, but that will probably work too.
Deepak Kumar Jena
Ranch Hand

Joined: Sep 08, 2010
Posts: 68

Thanks to all. I have done it.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
Well done. How did you do it?
Deepak Kumar Jena
Ranch Hand

Joined: Sep 08, 2010
Posts: 68

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Printing date