由于来自 Bigquery 数据库的查询响应,我必须使用 Civil.Datetime。
如何从 Golang 中的 Civil.Datetime 获取 time.Time 日期?
就像是:
var date time.Time = civil.ToTime(myCivilTime)
Run Code Online (Sandbox Code Playgroud)
我检查了民用时间文档:https : //godoc.org/cloud.google.com/go/civil并且有一个功能似乎可以满足我的要求。
func (d Date) In(loc *time.Location) time.Time
Run Code Online (Sandbox Code Playgroud)
但我不确定我应该如何设置 *time.Location 参数。