By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,605 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

DateTimePicker Control

P: n/a
I am trying to write an app in C# that requires the user to enter a date
from 4000 B.C.E to 4000 C.E. I tried to use the DateTimePicker Control
to allow the user to enter the date, but it only supports the Gregorian
Calendar, so the earliest date it allows is in 1752 C.E.

Is there a way to override the DateTimePicker control's minimum allowed
date, or am I forced to resort to the less user-friendly use of three
separate text boxes for month, day and year?

Todd

Jun 30 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can extend the DateTimePicker control, there is a sample in:
http://www.codeproject.com/KB/select...imepicker.aspx

Before extending you need to be aware of the following facts:
DateTimePicker has a date range: 1 Jan 1753 - 31 Dec 9998
System.DateTime type has date range: 1 Jan 0001 - 31 Dec 9999
SQL Server DateTime type has date range: 1 Jan 1753 - 31 Dec 9999

--
dUKE
"Todd Carnes" wrote:
I am trying to write an app in C# that requires the user to enter a date
from 4000 B.C.E to 4000 C.E. I tried to use the DateTimePicker Control
to allow the user to enter the date, but it only supports the Gregorian
Calendar, so the earliest date it allows is in 1752 C.E.

Is there a way to override the DateTimePicker control's minimum allowed
date, or am I forced to resort to the less user-friendly use of three
separate text boxes for month, day and year?

Todd

Jul 1 '08 #2

P: n/a
dUKE wrote:
You can extend the DateTimePicker control, there is a sample in:
http://www.codeproject.com/KB/select...imepicker.aspx

Before extending you need to be aware of the following facts:
DateTimePicker has a date range: 1 Jan 1753 - 31 Dec 9998
System.DateTime type has date range: 1 Jan 0001 - 31 Dec 9999
SQL Server DateTime type has date range: 1 Jan 1753 - 31 Dec 9999
Thank you very much for the link. I do have one more question.

If I extend the DateTimePicker to accept the dates I require, I
shouldn't need to worry about the limitations you listed above as long
as I'm handling all the actual processing of the dates with my own code,
correct? ... Or will the System.DateTime limitation still be a problem?
(SQL Server's not going to be in the picture for this project.)

Todd
Jul 1 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.