TIniFile.ReadDateTime doesn't read value written by TIniFile.WriteDateTime
Original Reporter info from Mantis: mobilevil
-
Reporter name: Ka-Chun Cheng
Original Reporter info from Mantis: mobilevil
- Reporter name: Ka-Chun Cheng
Description:
My PC's default date format is dd-MMM-yyyy HH:MM:SS
the date is written to the ini file correctly.
but when it is read back, ReadDateTime only return the provided default value.
if I enable custom format setting by inifile.FormatSettingsActive:=true, the date is read correctly.
it is the same for ReadDate and ReadDateTime
Steps to reproduce:
inifile.WriteDateTime('lazarus','datetime', now);
thetime:=inifile.ReadDateTime('lazarus','datetime', 0);
edit1.text:=datetimetostr(thetime);
[lazarus]
datetime=06-Apr-18 14:17:18
Additional information:
documentation of ReadDate/ReadDateTime says...
The international settings of the SysUtils are taken into account when
deciding if the read value is a correct date.
Mantis conversion info:
- Mantis ID: 33572
- OS: Windows
- OS Build: 10
- Build: latest SVN trunk, 38692
- Platform: X86
- Version: 3.0.4