Hi
I'm setting the Format property on a TAdvDateTimePicker
format:='dd, mmm yyyy';
And when I use it I get the following error:
exception class EConvertError with message "Tue, 22 May 2018" is not a valid date.
Am I using the format property incorrectly?
Bruce.
If your formatis set to dd, mmm yyyy a valid date would be "22, May 2018"
You see the same issue when trying it directly in code:
var
s: string;
d: tdatetime;
begin
formatsettings.shortdateformat := 'dd, mmm yyyy';
s := '22, May 2018';
d := strtodate(s);
s := 'Tue, 22 May 2018';
d := strtodate(s);
end;
The first goes ok, the second fails.
Bruno
Can you give me an example of what string I should put in the Format property for the component (v2.4.0.0) to work?
No matter which one I try:-
d mmm yyyy
d mmmm yyyy
dd mmmm yyyy
I get an invalid date exception every time I select the dropdown.
I've tried to set the formatsettings.shortdateformat as well to match the one I use in the component to no effect.
Bruce.
I tried it here with: d/MM/yy and see no issue. Or d-MM-yyyy also no issue.
This is with the latest version of the component.
1 Like