Wednesday, June 26, 2013

Java; parsing dates

Most of the time, this works just fine:

how to create Date object from String value
http://stackoverflow.com/questions/15760248/how-to-create-date-object-from-string-value

This also has merit and I love how short and concise it is:
 
Larry's Road to J2EE: How to convert String to XMLGregorianCalendar
http://larryjjcao.blogspot.com/2012/04/how-to-convert-string-to.html

The Date class seems to be frowned upon for direct use since it is riddle with deprecation warnings (at least for creating dates using the class's constructors).  It instead seems more favorable using Calendar or GregorianCalendar.

No comments:

Post a Comment