Aftab Garm
Aftab Garm

Reputation: 175

Date Time Picker Custom Format

this is my code:

dateTimePicker1.ShowUpDown = true;

dateTimePicker1.CustomFormat = "HH:MM";

dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;

Hi I use Custom Format for my dateTimePicker until do not show second but its format hide AM/PM in dateTimePicker how can show AM/PM in this format

Upvotes: 6

Views: 13560

Answers (1)

John Woo
John Woo

Reputation: 263943

just add tt for AM/PM.

dateTimePicker1.CustomFormat = "HH:mm tt"

and it should be mm for minutes.

Upvotes: 7

Related Questions