Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何以秒为单位将当前日期时间转换为纪元/unix 时间?
据我所知,下面列出的功能不提供此功能..
日期时间函数
在 C# 中,它会以这种方式完成
var epoch = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
你可以在 M 中做一些非常相似的事情:
epoch = Duration.TotalSeconds(DateTimeZone.UtcNow() - #datetimezone(1970, 1, 1, 0, 0, 0, 0, 0))