Subject | Re: [firebird-support] Inserting a date in Firebird |
---|---|
Author | Martijn Tonies |
Post date | 2004-01-09T07:55:28Z |
Hi Anand,
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
> I want to insert a date value in a table. What is the best wayActually, "current_timestamp" is a SQL standard function.
> 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.
> A more serious problem is with arbitrary dateIf you're trying to add the current date, I would never
> 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?
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