【发布时间】:2017-12-31 00:48:05
【问题描述】:
我目前正在将代码从 go 移植到 c# 并遇到了这段(简化的)代码。
我知道它使用给定格式060102150405 转换给定字符串171228175744.085。
官方文档中只有使用2017-Feb-1 等常见格式的示例,而不是这种格式(可能的时间戳?)
我知道这会导致时间蜂鸣2017-12-28 17:57:44.085 +0000 UTC,但我不知道如何,因为我不知道字符串171228175744.085 和布局代表什么。我知道其中一些信息与 GPS 相关。所以,我的问题是:有谁知道如何在 c# 中做到这一点?
package main
import (
"fmt"
"time"
)
func main() {
t, err := time.Parse("060102150405", "171228175744.085")
if err == nil{
fmt.Println(t)
}
}
【问题讨论】: