Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# C格式日期时间ddMMMyy_C#_Datetime - Fatal编程技术网

C# C格式日期时间ddMMMyy

C# C格式日期时间ddMMMyy,c#,datetime,C#,Datetime,有没有办法将DateTime格式化为C中的以下字符串 29JUN91 我在网上找不到任何允许我们以短字符串形式书写月份的内容。尝试使用ToString-Dmmyy 使用.ToUpper;如果您想将月份转换为大写。请查看自定义日期格式 DateTime.Now.ToString("ddMMMyy").ToUpper(); DateTime input = new DateTime(1991, 6, 29); //29JUN91 string result = input.ToString

有没有办法将DateTime格式化为C中的以下字符串

29JUN91
我在网上找不到任何允许我们以短字符串形式书写月份的内容。

尝试使用ToString-Dmmyy

使用.ToUpper;如果您想将月份转换为大写。

请查看自定义日期格式

   DateTime.Now.ToString("ddMMMyy").ToUpper();
DateTime input = new DateTime(1991, 6, 29); //29JUN91
string result = input.ToString("ddMMMyy").ToUpper();
2位数日的dd MMM表示月份的缩写名称 2位数年份的yy,从00到99
tostringdmmyy@HelpASisterOut然后你需要解释它是如何不起作用的,因为这是答案我在网上找不到任何东西[…]是我搜索C datetime格式时第一个遇到的问题
DateTime input = new DateTime(1991, 6, 29); //29JUN91
string result = input.ToString("ddMMMyy").ToUpper();