如何在Windows 10中更改系统日期时间? [英] How to change system datetime in windows 10?
本文介绍了如何在Windows 10中更改系统日期时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
目前我正在使用Win10,在底部日期显示为格里高利日期,
但是当我使用DateTime.Now()获得Hijri Date。
我尝试过:
Hi guys,
Currently i'm using Win10, where at the bottom the date is displaying as gregorian date,
but when i'm using DateTime.Now() is getting Hijri Date.
What I have tried:
Label1.Text = DateTime.Now.ToString();
Output:
06/11/37 09:46:04 ص
我想要这里默认Grigorian DateTime。
任何人都可以帮助我。
谢谢
I want Grigorian DateTime here as default.
Can anyone please help me.
Thanks
推荐答案
DateTime值没有格式。在内部,它只是自.NET的纪元,0001-01-01 00:00以来的刻度计数。格式化就是你调用ToString。
只需使用不同的CultureInfo来获得你想要的日历文化,例如
A DateTime value has no format. Internally it's just a count of ticks since the epoch, 0001-01-01 00:00 in .NET. Formatting is when you call ToString.
Just use a different CultureInfo for the culture that has the calendar you want, e.g.
CultureInfo french = CultureInfo.GetCultureInfo("fr-FR");
String nowStr = DateTime.Now.ToString( french );
< b>
如果您只是将可预测的西方文化与格里高利历一起使用,请使用CultreInfo.InvariantCulture。
这篇关于如何在Windows 10中更改系统日期时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文