TAdvDateTimePicker Format


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?


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:

  s: string;
  d: tdatetime;

  formatsettings.shortdateformat := 'dd, mmm yyyy';

  s := '22, May 2018';
  d := strtodate(s);
  s := 'Tue, 22 May 2018';
  d := strtodate(s);

The first goes ok, the second fails.

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.


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