Tips and tricks for .NET using ASP and VB code.

Convert date and time to Unix (POSIX) time

Public Function DateTimeToUnix(ByVal DateTime As Date) As Long
    Return (DateTime.ToUniversalTime().Ticks - 621355968000000000) / 10000000
End Function

No comments:

Post a Comment

Search This Blog