日期时间为UnixTime邮票在.NET [英] DateTime to UnixTime Stamp in .net

查看:155
本文介绍了日期时间为UnixTime邮票在.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有在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

这篇关于日期时间为UnixTime邮票在.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆