Merge branch 'master' of https://gitlink.org.cn/JointCloud/pcm-coordinator
Former-commit-id: e464751f27829cb8d59f33aca3fb17c2169f1a0f
This commit is contained in:
commit
bf2019bf3f
|
@ -85,7 +85,7 @@ func MillisecondsToUTCString(milliseconds int64, layout string) string {
|
|||
// 创建time.Time对象
|
||||
timeObj := time.Unix(timestamp, (milliseconds%1000)*int64(time.Millisecond))
|
||||
// 使用RFC3339格式返回UTC时间字符串
|
||||
return timeObj.UTC().Format(layout)
|
||||
return timeObj.Local().Format(layout)
|
||||
}
|
||||
|
||||
// SecondsToUTCString 将秒时间戳转换为UTC时间的字符串表示
|
||||
|
@ -93,7 +93,7 @@ func SecondsToUTCString(seconds int64, layout string) string {
|
|||
// 创建time.Time对象
|
||||
timeObj := time.Unix(seconds, 0)
|
||||
// 使用RFC3339格式返回UTC时间字符串
|
||||
return timeObj.UTC().Format(layout)
|
||||
return timeObj.Local().Format(layout)
|
||||
}
|
||||
|
||||
// MillisecondsToAddDurationToUTCString 将毫秒时间戳加上持续时间毫秒后转换为UTC时间的字符串表示
|
||||
|
@ -105,5 +105,5 @@ func MillisecondsToAddDurationToUTCString(milliseconds int64, durationMillisecon
|
|||
// 添加持续时间
|
||||
duration := time.Duration(durationMilliseconds) * time.Millisecond
|
||||
// 返回加上持续时间后的UTC时间字符串
|
||||
return timeObj.Add(duration).UTC().Format(layout)
|
||||
return timeObj.Add(duration).Local().Format(layout)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue