I want to get a new Date
object with a SimpleDateFormat
applied to it. I would like to do something like:
SimpleDateFormat myFormat =
I think you're misunderstanding something here about what the Date
object is. Date
simply holds the information about a point in time - it doesn't have a format at all. When it comes to the String
representation of a Date
, this is where formatting comes into play. Only worry about the formatting when you are:
String
representation into a Date
object.Date
back into String
representation to display it in a certain way.