话不多说,看代码 t := time.Now() //获取当前时间 ut := t.UTC() //转换为UTC时间 time := ut.Format("2006-01-02T15:04:05Z") //格式化输出 运行结果