2

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 ?

JimPapas
  • 715
  • 2
  • 12
  • 27

1 Answers1

5

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.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Ken White
  • 123,280
  • 14
  • 225
  • 444
  • many thanksI I was thinging that **n** was stand for minutes and **m** for mohth – JimPapas Jun 14 '16 at 23:41
  • 1
    @JimPapas: `n` is minutes in [`FormatDateTime()`](http://docwiki.embarcadero.com/Libraries/en/System.SysUtils.FormatDateTime) and related functions. But not in `TDateTimePicker`. – Remy Lebeau Jun 15 '16 at 00:35