How to get Date in the same format as String [duplicate]

java.util.Date doesn’t have format. Its just Date.

You can make it print its values in any form you want, by using SimpleDateFormat

Leave a Comment