C#中01/01/1753 DateTimePicker之前的最短日期? [英] Minimum date before 01/01/1753 DateTimePicker in C#?

查看:492
本文介绍了C#中01/01/1753 DateTimePicker之前的最短日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在DateTimePicker 01/01/0001或01/01/1753之前的任何日期在C#中设置最小日期值?

How can I set minimum date value in DateTimePicker 01/01/0001 or any date before 01/01/1753 in C#??

推荐答案

你可以' 't - DTP的最小日期是1753年1月1日(与SQL服务器相匹配,直到SQL Server 2008引入了支持1/1/1的DaetTime2类型)这也是因为来自Julian的传输在那一年发生的格里高利日历的日历。



虽然你可以改变DateTimePicker.MinDate值,但你不能在171年1月1日之前设置它,所以你不能在此之前输入任何数值。



最后一行的更正日期 - OriginalGriff [/ edit]
You can''t - the minimum date for a DTP is 1st Jan 1753 (to match with SQL server which also had this restriction until SQL Server 2008 which introduced teh DaetTime2 type which supports 1/1/1) THis was becasue of the trasnition from the Julian calender to teh Gregorian calander which happened in the that year.

While you can change the DateTimePicker.MinDate value, you cannot set it before 1/1/1753, so you cannot enter any value prior to this.

[edit]Corrected date in last line - OriginalGriff[/edit]


这篇关于C#中01/01/1753 DateTimePicker之前的最短日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆