Subject | Re: Date format using Delphi and Firebird |
---|---|
Author | Adam |
Post date | 2005-11-12T23:03:05Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
StrToDate function relies on the local PCs regional settings short
date format to decide whether to use dd/mm/yyyy or mm/dd/yyyy. So
don't use it to format dates (personally I think it should be removed
from Delphi).
You can use encodedate to convert a day month and year into a date,
and this is multi-region safe. But as Helen said, use the .Date or
.DateTime property on pretty much any date picker-ish looking
component, it saves you a lot of coding and is less likely to
introduce a bug.
Adam
wrote:
>field into a
> At 02:34 PM 12/11/2005 +0200, you wrote:
> >Hi,
> >
> >
> >
> >What must I make sure of before inserting a record with a date
> >Firebird 1.5 table? I get the EConvertError error 'is not a validdate',
> >using Delphi 7. The field is declared as a Date field in the table.I assign
> >the field a value as follows -02:00:19
> >
> > qryGen.ParamByName('workdate').Value := strtodate('2005/11/12
> >PM');One extra thing.
StrToDate function relies on the local PCs regional settings short
date format to decide whether to use dd/mm/yyyy or mm/dd/yyyy. So
don't use it to format dates (personally I think it should be removed
from Delphi).
You can use encodedate to convert a day month and year into a date,
and this is multi-region safe. But as Helen said, use the .Date or
.DateTime property on pretty much any date picker-ish looking
component, it saves you a lot of coding and is less likely to
introduce a bug.
Adam