user3140961
user3140961

Reputation:

TDatetimePicker format shows wrongly

If i set the property "format" of a TDateTimePicker component (Delphi XE10) eg. ddd d/m/yyyy then it shows Tue 14/47/2016 !! and the date 31/12/2016 as 31/0/2016 ! what is happening, please ?

Upvotes: 2

Views: 1115

Answers (1)

Ken White
Ken White

Reputation: 125669

That date format is incorrect. You need to use uppercase M, as is shown in the TDateTimePicker.Format documentation. Lower-case m represents minutes in a time format.

m    The one- or two-digit minute.
mm   The two-digit minute. Single-digit values are preceded by a zero.
M    The one- or two-digit month number.
MM   The two-digit month number. Single-digit values are preceded by a zero.
MMM  The three-character month abbreviation.
MMMM The full month name. 

ddd MM/dd/yyyy shows Tue 06/14/2016, and ddd dd/MM/yyyy shows Tue 14/06/2016.

Upvotes: 4

Related Questions