DelphiFAQ Home Search:

Current date / time in InterBase

 

comments2 comments. Current rating: 5 stars (1 votes). Leave comments and/ or rate it.

Question:

How can I determine the current date / time in InterBase? (Version 5.0)


Answer:

InterBase supports four DATE literals. They are: 'today', 'yesterday', 'tomorrow' and 'now'
Use it with a cast as shown in the example below.

insert into mytable 
(TIME_FIELD, MESSAGE_FIELD)
values(cast('now' as DATE), 'Test')

Comments:

2006-02-23, 05:54:38
malmosi@freemail.hu from Hungary  
It also works:

insert into mytable(time_field, message_field)
values(current_time,'Test')

other functions:

current_date, current_timestamp
2006-06-28, 15:53:14
anonymous from Brazil  
rating

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Washington, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
Leave your comment here:
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.