I have a date variable that I want to convert into a good looking string (example: dd/MM/yyyy). As you can see in the code I have already tried multiple different approaches, but non of them seem to work. Hopefully someone can help me with this! :)
Asked
Active
Viewed 44 times
-4
Fildor
- 12,873
- 4
- 34
- 64
-
1Hi! I good rule of thumb is that if you run into a problem that seems like others would run into, it's *probably* been solved by someone and there's a library for it. Have you tried searching on Stackoverflow, something like "date library java"? – Alex K May 23 '22 at 16:19
-
2please check [Why should I not upload images of code/data/errors when asking a question?](https://meta.stackoverflow.com/q/285551/16320675) || in Java we can use [DateTimeFormatter](https://docs.oracle.com/en/java/javase/18/docs/api/java.base/java/time/format/DateTimeFormatter.html) to format dates – user16320675 May 23 '22 at 16:21
-
Look for Answers using `LocalDate` and `DateTimeFormatter`, not the terrible legacy classes `Date`, `Calendar`, `SimpleDateFormat`. – Basil Bourque May 23 '22 at 16:37