Ooh … Begitu! I see, I see …

Icon

Setelah kelayapan di internet, cari-cari info dari sana-sini dan bongkar pasang tips (terutama programming), akhirnya baru sadar … ternyata begitu caranya … [all about tricks and tips I have found during my work as programmer.]

get current date time in 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. 🙂

Advertisements

Filed under: Firebird

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives

%d bloggers like this: