Golang是否有本地日期的概念?

huangapple go评论70阅读模式
英文:

Does golang have a local date concept?

问题

golang的time包(或任何其他库)是否支持本地日期的概念?
所谓本地日期,是指没有时间或时区的日期概念,类似于joda time中支持的概念。

英文:

Does golang's time package (or any other library) support the concept of a local date?
By local date, I'm referring to the concept supported by joda time, which is a date without a time or timezone.

答案1

得分: 1

你所提到的包使用的是UTC时间:

这个时间轴将在所有计算中被设置为UTC时区。

你可以使用time包来获取UTC时间,并在其上进行计算。

英文:

The package you refer to uses UTC :

> This chronology will be set internally to be in the UTC time zone for all calculations.

You can simply get the UTC time using the time package and do calculations on that.

huangapple
  • 本文由 发表于 2015年2月8日 07:06:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/28388554.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定