Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830
this week in the
Programmer Certification
forum!
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
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
paul wheaton
Sheriffs:
Ron McLeod
Devaka Cooray
Henry Wong
Saloon Keepers:
Tim Holloway
Stephan van Hulst
Carey Brown
Tim Moores
Mikalai Zaikin
Bartenders:
Frits Walraven
Forum:
Java in General
Date Format Issues
Steve Dyke
Ranch Hand
Posts: 2259
2
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I do I fix the following when the date from my source is say 01/01/09 I get a result of 01/01/0009.
SimpleDateFormat dateFormatter = new SimpleDateFormat( "MM/dd/yyyy" ); Date startDate = dateFormatter.parse( rsa.getString("psdatem") );
Dan Murphy
Ranch Hand
Posts: 126
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I think if you specify the year as yy (instead of yyyy) it will parse 09 to 2009.
SCJP, SCJD, SCWCD
bart zagers
Ranch Hand
Posts: 234
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The exact behavior is explained in the
SimpleDateFormat
documentation.
Steve Dyke
Ranch Hand
Posts: 2259
2
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks, works great.
We begin by testing your absorbancy by exposing you to this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Problem in Coverting one Date Format to Other date Format
simpleDateFormat Problems and questions
Date 01/01/1970 returning non-zero value for time
how to convert date to a string
DateFormat Error
More...