Firebird 5: LOCALTIME and LOCALTIMESTAMP

152 views
Skip to first unread message

Paulo Geloramo

unread,
Feb 18, 2024, 1:29:31 PM2/18/24
to firebird...@googlegroups.com
Firebird 5
Fields:
CURRENT_TIME = LOCALTIME
TIMESTAMP = LOCALTIMESTAMP

It is recommended to update the database fields to use
LOCALTIME and LOCALTIMESTAMP or can you keep the database with
CURRENT_TIME and TIMESTAMP fields?
--
Paulo Esteves

Dimitry Sibiryakov

unread,
Feb 18, 2024, 3:11:14 PM2/18/24
to firebird...@googlegroups.com
Paulo Geloramo wrote 18.02.2024 19:29:
> It is recommended to update the database fields to use
> LOCALTIME and LOCALTIMESTAMP or can you keep the database with
> CURRENT_TIME and TIMESTAMP fields?

If you are not ready to handle TIME(STAMP) WITH TIME ZONE - definitely you
have to update.

--
WBR, SD.

Mark Rotteveel

unread,
Feb 19, 2024, 9:16:06 AM2/19/24
to firebird...@googlegroups.com
On 18/02/2024 19:29, Paulo Geloramo wrote:
> Firebird 5
> Fields:
> CURRENT_TIME = LOCALTIME
> TIMESTAMP = LOCALTIMESTAMP

I assume you meant replace CURRENT_TIMESTAMP with LOCALTIMESTAMP. This
is, BTW, since Firebird 4.0, not Firebird 5.0, and these functions were
backported to Firebird 2.5.9 and 3.0.4 for ease of migration (on
Firebird 2.5.9 and 3.0, they are aliases for CURRENT_TIME and
CURRENT_TIMESTAMP).

> It is recommended to update the database fields to use
> LOCALTIME and LOCALTIMESTAMP or can you keep the database with
> CURRENT_TIME and TIMESTAMP fields?

You should change it, since CURRENT_TIME and CURRENT_TIMESTAMP now
return TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE, so using them
in combination with a field or variable of type TIME (WITHOUT TIME ZONE)
or TIMESTAMP (WITHOUT TIME ZONE), they will undergo a conversion from
WITH TIME ZONE to WITHOUT TIME ZONE which you avoid when using LOCALTIME
and LOCALTIMESTAMP.

Mark
--
Mark Rotteveel

Reply all
Reply to author
Forward
0 new messages