• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

SimpleDateFormat

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again,

Does anyone know if its OK to use SimpleDateFormat in this project? The documentation for constructors in this class says "This constructor may not support all locales. For full coverage, use the factory methods in the DateFormat class." Is this not portable enough?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike,

I just handled the dates as Strings, so no conversions or formatting (because you don't need it to find and book rooms). But a SimpleDateFormat will do the job. Although if I'm not mistaken it generates a valid date, also when you have a String that doesn't exactly match the pattern. More info can be found here.

Kind regards,
Roel
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Mike!

Roel De Nijs wrote:I just handled the dates as Strings, so no conversions or formatting (because you don't need it to find and book rooms).



Me too! And Mike, since you are not required to format them, my advice would be to keep things as simple as possible and not to format them.
 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic