• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date Format Issues  RSS feed

 
Ranch Hand
Posts: 1826
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think if you specify the year as yy (instead of yyyy) it will parse 09 to 2009.
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exact behavior is explained in the SimpleDateFormat documentation.
 
Steve Dyke
Ranch Hand
Posts: 1826
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, works great.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!