On 2021-05-19 19:40, Omacht András wrote:
Hi!
Since Firebird 2.5, we have been able to replace almost all UDFs with
built-in functions.
There is only one left (it’s the Highlander :)) : formatting dates
and timestamps to readable format for hungarian people:
-- Hungarian format
select to_char(cast('TODAY' as date), 'YYYY.MM.DD') from rdb$database
-- 2021.05.19
-- English format
select to_char(cast('TODAY' as date), 'DD/MM/YYYY') from rdb$database
-- 19/05/2021
-- Year + month
select to_char(cast('TODAY' as date), 'YY/MM') from rdb$database
-- 21/05
-- Short hungarian format
select to_char(cast('2001.5.7' as date), 'YY.MM.DD') from rdb$database
-- 01.05.07
-- Hungarian timestamp format
select to_char(cast('NOW' as timestamp), 'YYYY.MM.DD hh:mm:ss') from
rdb$database
-- 2021.05.19 19:05:46
etc.
If anyone has an idea of what can be used instead, I would greatly
appreciate it.
Of course, a built-in function would be best, but please, this should
not be the suggestion:
The following should be a SQL standard replacement to format dates (and
parse from a specific format):
https://github.com/FirebirdSQL/firebird/issues/2388; not implemented
yet, nor actually planned for a version.
Mark
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel