Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DateTime Picker In WinForm How To Pick Time? [duplicate]

Tags:

Possible Duplicate:
DateTimePicker: pick both date and time

I'm using a WinForm DateTime picker and it does a fantastic job of choosing dates, but I don't know how to do times. It looks like a time is associated with the value, so maybe there's a way to use this to pick a time?

If there is no built in way to do this, I'll just create another box for the time and modify the DateTime value from the DateTime picker.

Thanks!

like image 711
sooprise Avatar asked Sep 16 '10 15:09

sooprise


People also ask

How do I set the time on my datetime picker?

It Seems simple. $('#startdatetime-from'). datetimepicker({ language: 'en', format: 'yyyy-MM-dd hh:mm' });

What is date/time picker in C#?

A DateTimePicker control allows users to select a date and time in Windows Forms applications. In this tutorial, we will see how to create a DateTimePicker control at design-time as well as at run-time, set its properties and call its methods.

What is the use of date/time picker control?

Definition. Represents a Windows control that allows the user to select a date and a time and to display the date and time with a specified format.


1 Answers

You can use the built in DateTime picker by adding a custom format string as follows:

DateTimePicker.ShowUpDown = true; DateTimePicker.CustomFormat = "hh:mm"; DateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom; 

Enjoy!

like image 92
Doug Avatar answered Oct 25 '22 10:10

Doug