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?
207 Views Asked by tycho de vink At
2
There are 2 best solutions below
0
On
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:
substr(datecol, 6)
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.
In apex, you can set the date format for your application in multiple places