Date Converter - 1 line of code
Converts a Date to Unix format. (e.i. the number of seconds since January 1, 1970.)
AI
AI 요약: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
소스 코드
Public Function UnixDate(vDate As Date) As Long
'Returns Unix Date (number of
' seconds since Jan 1, 1970)
' Example: Text1.Text = UnixDate(Now)
UnixDate = DateDiff("s", "1/1/1970 12:00:00 AM", vDate)
End Function
Public Function FromUnixDate(vUnixDate As Long) As Date
'To Convert Back
FromUnixDate = DateAdd("s", vUnixDate, "1/1/1970 12:00:00 AM")
End Function
원본 댓글 (3)
Wayback Machine에서 복구됨