Icon View Incident Report

Serious Serious
Reported By: Ivan Mihailov
Reported On: 11/19/2012
For: Version 1.01 Build 2
# 3696 StrToDate Returning Incorrect Results

See the following code:

var  TempDate:    DateTime;
     TempString:  String; 

1.
FormatSettings.DateSeparator   := '.';
FormatSettings.ShortDateFormat := 'dd.MM.yyyy';

TempString := '23.07.2012';
TempDate := StrToDate(TempString);
ShowMessage(DateToStr(TempDate));  -->  NaN.NaN.NaN 

2.
FormatSettings.DateSeparator   := '-';
FormatSettings.ShortDateFormat := 'dd-MM-yyyy';

TempString := '23-07-2012';
TempDate := StrToDate(TempString);
ShowMessage(DateToStr(TempDate));  -->  23-05--2013  

3.
FormatSettings.DateSeparator   := '/';
FormatSettings.ShortDateFormat := 'dd/MM/yyyy';

TempString := '23/07/2012';
TempDate := StrToDate(TempString);
ShowMessage(DateToStr(TempDate));  -->  23/07/2012



Comments Comments
The date-parsing was having issues with decimal separators that also belong to floating-point numbers.


Resolution Resolution
Fixed Problem on 11/19/2012 in version 1.01 build 3


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image