Wrong conversion from vardate variants to string
Original Reporter info from Mantis: luizamerico
-
Reporter name: Luiz Americo
Original Reporter info from Mantis: luizamerico
- Reporter name: Luiz Americo
Description:
Currently variants of type vardate always convert to string using DateToStr. This is incompatible with Delphi.
Under Delphi when a variant has a TDateTime with both date and time parts <> 0 the conversion is done with 'd/m/yyyy hh:nn:ss' format
When only time part is set is converted with 'hh:nn:ss'. Notice that these formats are fixed and does not depend of shortdateformat or alike
Currently in fpc the conversion is always done to date using shortdateformat
Attached is a test program and a patch.
Below are the output from fpc and delphi
fpc:
Date: 04-03-2011
Time: 19:28:52
DateTime: 04-03-2011 19:28:52
VarDate: 04-03-2011
VarTime: 12-30-1899
VarDateTime: 04-03-2011
Delphi
Date: 04-03-2011
Time: 19:30:02
DateTime: 04-03-2011 19:30:02
VarDate: 3/4/2011
VarTime: 19:30:02
VarDateTime: 3/4/2011 19:30:02
Mantis conversion info:
- Mantis ID: 19075
- OS: Windows
- OS Build: XP
- Platform: i386
- Fixed in version: 2.6.0
- Fixed in revision: 17259 (#c17afffb)