[英]what is the range of DateTime.TryParseExact or Convert.ToDateTime() having date format dd/MM/yy
I want to know the range of DateTime.TryParseExact method or Convert.ToDateTime() having dd/MM/yy as input format. 我想知道具有dd / MM / yy作为输入格式的DateTime.TryParseExact方法或Convert.ToDateTime()的范围。 like
喜欢
DateTime.TryParseExact("01/07/05","dd/MM/yy", new CultureInfo("en-US"),DateTimeStyles.None, out dateValue)
or 要么
DateTime Time=Convert.ToDateTime("01/07/05");
If i will give 01/07/35, it will not know whether I am talking about 1835,1935,2035. 如果我将在01/07/35给出,它将不知道我是否在谈论1835,1935,2035。 So defiantly it has some range.
如此挑衅它有一定的范围。 Any body know about its rang with some reference ?
有没有人知道它的一些参考?
Thanks 谢谢
If you're asking how a two digit year is interpreted, it depends on the culture's TwoDigitYearMax property 如果你问的是如何解释两位数的年份,它取决于文化的TwoDigitYearMax属性
Which depends on the computer's settings. 这取决于计算机的设置。 To see what the setting is go to:
要查看设置的内容:
Year values from 00 to 29 will give you the years 2000 to 2029, values from 30 to 99 will give you the hears 1930 to 1999. 从00到29的年份值将为您提供2000年至2029年的年份,从30到99的值将为您提供1930年至1999年的听力。
The value new CultureInfo("en-US").DateTimeFormat.Calendar.TwoDigitYearMax
contains 2029
, which determines the breaking point. 值为
new CultureInfo("en-US").DateTimeFormat.Calendar.TwoDigitYearMax
包含2029
,它确定断点。
DateTime
range is between DateTime.MinValue
( 00:00:00.0000000, January 1, 0001 ) to DateTime.MaxValue
( 23:59:59.9999999, December 31, 9999 ). DateTime
范围介于DateTime.MinValue
( 00:00:00.0000000,0001年1月1日 )至DateTime.MaxValue
( 23:59:59.9999999,12月31日,9999 )之间。
http://msdn.microsoft.com/en-us/library/system.datetime.minvalue.aspx http://msdn.microsoft.com/en-us/library/system.datetime.minvalue.aspx
http://msdn.microsoft.com/en-us/library/system.datetime.maxvalue.aspx http://msdn.microsoft.com/en-us/library/system.datetime.maxvalue.aspx
Default century is controlled by http://msdn.microsoft.com/en-us/library/system.globalization.calendar.twodigityearmax.aspx 默认世纪由http://msdn.microsoft.com/en-us/library/system.globalization.calendar.twodigityearmax.aspx控制
认为它将假设当前[编辑]世纪(而不是千年)(在系统时钟中设置)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.