Is there a method in Java that I can use to convert MM/DD/YYYY
to DD-MMM-YYYY
?
For example: 05/01/1999
to 01-MAY-99
Thanks!
Is there a method in Java that I can use to convert MM/DD/YYYY
to DD-MMM-YYYY
?
For example: 05/01/1999
to 01-MAY-99
Thanks!
Java 8 LocalDate
Use a SimpleDateFormat to parse the date and then print it out with a SimpleDateFormat withe the desired format.
Here's some code:
Output:
Below should work.
java.time
You should use java.time classes with Java 8 and later. To use java.time, add:
Below is an example, how you can format date.
Try this,