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
Any help is appre
In javascript, at least, unix timestamps are milliseconds, and I found a case where I needed them. This code makes use of .Net using 10,000 ticks / millisecond. Here's the code I used:
Public Module UnixTime
Const UnixEraStartTicks As Long = 621355968000000000
Public Function UnixTimestamp(value As Date) As Long
Dim UnixEraTicks = value.Ticks - UnixEraStartTicks
Return UnixEraTicks \ 10000
End Function
Public Function DateFromUnix(timestamp As Long) As Date
Return New Date(UnixEraStartTicks + timestamp * 10000)
End Function
End Module