什么是DateTime.TryParseExact或Convert.ToDateTime(),具有日期格式DD / MM / YY的范围

编程入门 行业动态 更新时间:2024-10-18 08:24:06
本文介绍了什么是DateTime.TryParseExact或Convert.ToDateTime(),具有日期格式DD / MM / YY的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道DateTime.TryParseExact方法或Convert.ToDateTime()有DD / MM / YY输入格式的范围。 类似

I want to know the range of DateTime.TryParseExact method or Convert.ToDateTime() having dd/MM/yy as input format. like

DateTime.TryParseExact("01/07/05","dd/MM/yy", new CultureInfo("en-US"),DateTimeStyles.None, out dateValue)

DateTime Time=Convert.ToDateTime("01/07/05");

如果我会给35年1月7日,它将不知道我是否在谈论1835年, 1935,2035。所以挑衅它有一定的范围。任何机构了解它的响了起来具有一定的参考?

If i will give 01/07/35, it will not know whether I am talking about 1835,1935,2035. So defiantly it has some range. Any body know about its rang with some reference ?

感谢

推荐答案

如果你问一个两位数的年份如何解释,这取决于文化的的 TwoDigitYearMax 财产

If you're asking how a two digit year is interpreted, it depends on the culture's TwoDigitYearMax property

依赖于计算机的设置。要查看该设置,请访问:

Which depends on the computer's settings. To see what the setting is go to:

  • 控制面板 - >区域和语言选项
  • 定制(XP)或其它设置(Win7的)
  • 日期选项卡。有两个数字的年份如何解释有设置。在我的电脑它解释为1930年和2029之间。
  • 更多推荐

    什么是DateTime.TryParseExact或Convert.ToDateTime(),具有日期格式DD / MM / YY的范围

    本文发布于:2023-11-07 19:42:23,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1567246.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:日期   格式   Convert   DateTime   TryParseExact

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!