Google Cloud Datastore 中的日期区域设置
Dates locale in Google Cloud Datastore
我使用 Go 客户端库将日期存储在 Google 云数据存储中。日期在 go 代码中作为 time.Time 类型进行管理。文档中有点不清楚的是如何检索日期。文档说它们是按当地时间检索的,我的问题是:"local time of the server or the client?"
此外,我希望检索到的日期与保存的语言环境相同。
数据存储包设置Go程序的time's location to the local location。
更多详情:
时间在数据存储服务中保存为 Unix 纳秒。该位置未保存。
数据存储包使用 time.Unix function to convert Unix nanoseconds to a time.Time
value. The time.Unix function sets the location to the local location。
我使用 Go 客户端库将日期存储在 Google 云数据存储中。日期在 go 代码中作为 time.Time 类型进行管理。文档中有点不清楚的是如何检索日期。文档说它们是按当地时间检索的,我的问题是:"local time of the server or the client?"
此外,我希望检索到的日期与保存的语言环境相同。
数据存储包设置Go程序的time's location to the local location。
更多详情:
时间在数据存储服务中保存为 Unix 纳秒。该位置未保存。
数据存储包使用 time.Unix function to convert Unix nanoseconds to a time.Time
value. The time.Unix function sets the location to the local location。