日期时间为UnixTime邮票在.NET时间为、邮票、日期、UnixTime

2023-09-03 06:41:08 作者:低吟

有没有在VB点网的任何功能,日期时间转换为UNIX时间戳 如果我谷歌我只得到了反之亦然而不是vb.net到UNIX时间戳

Is there any function in vb dot net to convert datetime to unix time stamp If I google I get only the vice versa but not vb.net to unix time stamp

任何帮助是pciated AP $ P $

Any help is appreciated

推荐答案

{}编辑删除旧参考链接

{Edit} removed old reference link

秒自1970年1月1日= UNIX时间

Seconds since Jan 1, 1970 = unix time

要得到这个在VB.NET见下面的例子(例如使用DateTime.UtcNow,但你可以在你想有任何的DateTime插件)

To get this in VB.NET see below example (in example using DateTime.UtcNow, but you can plug in any DateTime you want there)

Dim uTime As Integer
uTime = (DateTime.UtcNow - New DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds