I have old code that uses new Date(dateString)
to parse a date string. Compiling the code produces the deprecation warning Date(java.lang.String) in java.util.Date has been deprecated
.
The javadoc unhelpfully advises me to use DateFormat.parse()
, even though the DateFormat
class does not have a static parse
method.
Now, I know how to use SimpleDateFormat
, but I want to make sure I'm getting the exact same behaviour of the deperecated Date
constructor.