Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Date Time Picker Custom Format

Tags:

c#

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

like image 280
Aftab Garm Avatar asked Feb 18 '13 09:02

Aftab Garm


People also ask

How do I change date picker format in Excel?

Display the current date and time in a date pickerClick the Data tab. In the Data type box, click Date and Time (dateTime). Click Format. In the Date and Time Format dialog box, in the Display the time like this list, click the option that you want, and then click OK.

How do I change the date format from YYYY MM DD in jquery?

$("#txtDate"). datepicker({ dateFormat: 'yy-mm-dd' });


1 Answers

just add tt for AM/PM.

dateTimePicker1.CustomFormat = "HH:mm tt"

and it should be mm for minutes.

  • Custom Date and Time Format Strings
like image 89
John Woo Avatar answered Oct 20 '22 08:10

John Woo