Hi!

Mark: Yes, that could be good, but it’s not even in 4.0, so (one day) we 
wouldn’t be able to switch to 5.0 by rewriting these calls first.
For the time being, the original plan remains: writing a function, replacing 
udf calls with it ...

SD: If you have a single user interface and the message appears on it right 
away, it's of course worth formatting the output there. In our case, it often 
happens that the process does not leave the database when the message is 
generated. Dates must be saved as part of a text.

András


-----Original Message-----
From: Mark Rotteveel [mailto:m...@lawinegevaar.nl] 
Sent: Wednesday, May 19, 2021 8:04 PM
To: firebird-devel@lists.sourceforge.net
Subject: Re: [Firebird-devel] Deprecations

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

Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to