如何更改DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames集合 [英] How to change DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames collection

查看:81
本文介绍了如何更改DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改 DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames集合.我想使用我的,例如 Tues 而不是 Tue .当我使用 ToString("ddd")时,我想查看 Tue .

How to change DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames collection. I want to use mine, like Tues instead of Tue. And when I use ToString("ddd") I want to see Tue.

在C#中可以吗?

推荐答案

您可以通过这种方式

CultureInfo cinfo = CultureInfo.CreateSpecificCulture("en-EN");
cinfo.DateTimeFormat.AbbreviatedDayNames = new string[]{"Suns","Mon","Tues", "Weds","Thursday","Fries","Sats"};

现在将其指定为您当前的文化,您应该会很好

Now assign this as your current culture and you should be good to go

这篇关于如何更改DateTimeFormatInfo.CurrentInfo AbbreviatedDayNames集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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