I have a date that looks like this: 29-DEC-2020 00:00
I want to format it to dd-mon like this: 29-DEC
How do I convert this without doing it with to_char()
?
How to convert a date to a different format without making it a varchar?
198 views Asked by tycho de vink At
2
There are 2 answers
4

In apex, you can set the date format for your application in multiple places
- For the entire app, go to "Application Definition Attributes" (1st entry in shared components) > "Globalization". There you have the option to choose the format mask for all different date datatypes. This will effect every occurence of this datatype in your application.
- For a specific page item or for a report column, you can set the format mask under "Appearance" > "Format Mask"
If your "date" looks like
29-DEC-2020 00:00
, then it doesn't look like a date to me. It looks like a string.So, you can use string functions:
Of course, if it is really a date, you should either use
to_char()
or set the parameters to ignore the year in the UI. However, I strongly discourage you from doing that.