英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论