如何在git bash中设置正确的本地时区? [英] How to set the correct local time zone in git bash?
问题描述
我在Windows系统上使用git-bash。
Windows时钟显示当地时间,但在git-bash中,一切都在GMT时间内:
$ date
3月31日星期一16:08:57 GMT 2014
另外设置TZ不会改变事情:
$ TZ =欧洲/柏林日期
3月31日星期一16:09:01 GMT 2014
同样,所有时间 git log
仅仅是GMT。
有没有办法在git- bash?
TZ
变量似乎工作不同。 TZ = GST-1GDT日期
如果您将其设置为某些无效值,如Europe / Berlin
它将默认为GMT。
当我的系统没有设置TZ时,似乎也发生了这种情况。
通过上述设置,我得到 Thu Apr 17 16:23:23 GDT 2014
它与 Thu Apr 17 16:23:23 CEST 2014
不完全相同,但至少在时间看起来不错。
I am using git-bash on a Windows system.
The Windows clock shows local time, but inside git-bash everything is in GMT time:
$ date
Mon Mar 31 16:08:57 GMT 2014
Also setting TZ will not change things:
$ TZ="Europe/Berlin" date
Mon Mar 31 16:09:01 GMT 2014
Similarly all times it git log
are GMT only.
Is there a way to set the correct timezone in git-bash?
On Windows the TZ
variable seems to work differently.
To get the German timezone you have to write:
TZ=GST-1GDT date
If you set it to some "invalid" value like "Europe/Berlin"
it will default to GMT.
The same seems to happen on my system when TZ is not set at all.
With the above setting I get Thu Apr 17 16:23:23 GDT 2014
which is not exactly the same as Thu Apr 17 16:23:23 CEST 2014
, but at least the time looks right.
这篇关于如何在git bash中设置正确的本地时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!