- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我无法使用 C# 在我的 aspx 页面中提取意大利语的星期几名称。
我已经尝试过这个解决方案,但在输出中我有星期五,有什么问题吗?
DateTime ItalianJobCookie = DateTime.Parse(Request.Cookies["ItalianJob"].Value);
string ItalianJobCookieDayName = ItalianJobCookie.DayOfWeek.ToString("G", new CultureInfo("it-IT"));
Response.Write(ItalianJobCookieDayName.ToString());
最佳答案
DateTime.DayOfWeek
返回给定 DateTime 的 DayOfWeek
,它没有支持不同文化的 ToString
。这甚至是 documented :
The members of the DayOfWeek enumeration are not localized. To return the localized name of the day of the week, call the DateTime.ToString(String) or the DateTime.ToString(String, IFormatProvider) method with either the "ddd" or "dddd" format strings. The former format string produces the abbreviated weekday name; the latter produces the full weekday name.
而是将它与 DateTime
一起使用
string ItalianJobCookieDayName = ItalianJobCookie.ToString("dddd");
如果当前文化是意大利语,否则:
string ItalianJobCookieDayName = ItalianJobCookie.ToString("dddd", new CultureInfo("it-IT"));
如果您想要缩写的日期名称,请使用 ddd
而不是 dddd
。 Further informations .
关于c# - C# 中意大利语的星期几名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31243066/
本文实例为大家分享了php实现按天数、星期、月份查询的搜索框,搜索时候展示数据的统计图,主要展示图形的效果,供大家参考,具体内容如下 1.ajax.php ?
星期-时间时刻散点平面坐标系统计大小量,Python,matplotlib,散点图(1) 假设现在有一堆年月日时数据,形如t=2022-07-31 23:45:12,每一条这样的时刻都对应发生了一次事
我想以 EEEE d, MMMM 格式自定义此显示日、日期和月份格式。 提前致谢。 最佳答案 这是完全合乎逻辑的。你可以试试这个 public static class EndDatePickerFr
我是一名优秀的程序员,十分优秀!