Subject Re: [firebird-support] Inserting a date in Firebird
Author Martijn Tonies
Hi Anand,

> I want to insert a date value in a table. What is the best way
> to do it?
> For current date and time I can simply add the string
> "Current_TimeStamp" in
> the query and be done. The shortcoming of this method is the
> code will not
> be portable.

Actually, "current_timestamp" is a SQL standard function.

> A more serious problem is with arbitrary date
> values.
> We are using Delphi to build the front-end and the method
> described there to
> retrieve the local date settings of the system and formatting
> your date as
> per those settings is so tedious, I decided to opt for this
> question
> instead.
> In short, if I format my date in the format "mm/dd/yyyy", how
> would I insert
> this date into a table, making sure the date is correctly
> interpreted by the
> database?

If you're trying to add the current date, I would never
use the client date - these can easily be messed up for
all sorts of reasons. Better use the server date, as it's
the same for all workstations :-)

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com