File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes converting Date to String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "converting Date to String" Watch "converting Date to String" New topic
Author

converting Date to String

Ian Cockcroft
Greenhorn

Joined: Feb 17, 2002
Posts: 29
Hi all,
I am converting a Date to a String to place in a textField.
How do I do this?
My code so far:
Mahesh Mamani
Ranch Hand

Joined: Jun 25, 2001
Posts: 110
Originally posted by Ian Cockcroft:


Hello,
U try this
String stringOrderDate = dateOrderDate.toString();
Hope this helps...

Mahesh
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Here's the idea:
String stringOrderDate = dateOrderDate.toString();
or

Making sense?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Ian Cockcroft
Greenhorn

Joined: Feb 17, 2002
Posts: 29
100%, thanks guys.
but dont get comfortable, it wont be long before I got some more stuppid questions.
cheers
Ian
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

if you want to format it a certain way (not just the toString() default pattern you can use a SimpleDateFormat:

Jamie
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting Date to String