Re: [fpc-devel] Behavior of conversion between vardate variants and string in fpc and delphi

2011-04-04 Thread LacaK
Running this code in Delphi 7 gives the exception below: var V: Variant; D: TDateTime; begin ShortDateFormat := 'dd/mm/'; // the problem occurs regardless of the format option V := '20/04/2011'; D := V; Memo1.Lines.Add('Date: ' + DateToStr(D)); // required to avoid dead

Re: [fpc-devel] Behavior of conversion between vardate variants and string in fpc and delphi

2011-04-04 Thread LacaK
So, what should be done? 1) Be totally compatible with Delphi: convert date to string with hardcoded format and raise exception when doing the conversion back? 2) Use the hardcoded format used to convert from vardate variant to string and vice versa? 3) Use shortdateformat to convert from

Re: [fpc-devel] Behavior of conversion between vardate variants and string in fpc and delphi

2011-04-04 Thread Luiz Americo Pereira Camara
On 4/4/2011 04:34, LacaK wrote: So, what should be done? 1) Be totally compatible with Delphi: convert date to string with hardcoded format and raise exception when doing the conversion back? 2) Use the hardcoded format used to convert from vardate variant to string and vice versa? 3) Use

[fpc-devel] Behavior of conversion between vardate variants and string in fpc and delphi

2011-04-03 Thread Luiz Americo Pereira Camara
Hi, As pointed in bug http://bugs.freepascal.org/view.php?id=19075 converting from vardate variants (variants with TDateTime values) to string is done differently in Delphi and fpc. According to http://support.embarcadero.com/article/35913 the conversion is done with the default OS format

Re: [fpc-devel] Behavior of conversion between vardate variants and string in fpc and delphi

2011-04-03 Thread Sergei Gorelkin
Luiz Americo Pereira Camara пишет: So, what should be done? 1) Be totally compatible with Delphi: convert date to string with hardcoded format and raise exception when doing the conversion back? 2) Use the hardcoded format used to convert from vardate variant to string and vice versa? 3) Use