Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
String to Date?
Jessica James
Ranch Hand
Posts: 69
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Friends,
How to convert a
String
to a Date field?
what is the format of String to convert it to date..
Regards,
jessica
Ulf Dittmer
Rancher
Posts: 43081
77
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The java.text.SimpleDateFormat class does this. The code would be something like:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-DD"); Date myDate = sdf.parse("2007-03-17");
The javadocs for that class list the other possibilities to specify the date and time format.
Jessica James
Ranch Hand
Posts: 69
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Ulf,
Thanks for your reply..
Regards,
Jessica
Would you like to try a free sample? Today we are featuring tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
String conversion
String to Date conversion
How to store datetimepicker value into database
converting date string into Calendar.Day of Year
how to convert String into Date format
More...