get current date time in Firebird?

Posted on August 14, 2007. Filed under: Firebird |

a friend asked me:

hi, do you know how to get current date time directly from firebird sql? I need to make sure that every client that append or insert any data would use or access the same date time resource, I would like to use sql date time directly, because some of the clients would be from any other time zone. thank you in advance for your help.

hmmm ….

it should be around this way, I guess?

select
    current_date,
    current_time,
    current_timestamp
from rdb$database

oh … before I forget, you need to check the timestamp information in the firebirdsql.org at this url to make sure about the version of your database: http://www.firebirdsql.org/index.php?op=guide&id=ib6_newfeatures

and this one is a good summary about Date Literals in Firebird:
Firebird Date Literals (Excerpt from Chapter 10 of The Firebird Book © Helen Borrie 2004)

hope this helps. :)

Make a Comment

Make a Comment: ( None so far )

blockquote and a tags work here.

Liked it here?
Why not try sites on the blogroll...