I have a string obtained by calling the toString method of instance of the class Date. How can I get a Date object from this string?
toString
Date d
If your real goal is to serialize a Date object for some kind of custom made persistence or data transfer, a simple solution would be:
Date
Date d = new Date(); long l = d.getTime(); Date theSameDate = new Date(l);