Visual Basic 6 function "TimestampToDate"

Go back

Below you'll find the source for the Visual Basic 6 function TimestampToDate.

Attribute VB_Name = "modTimestampToDate"
' This function is downloaded from:
' You may freely distribute this file but please leave all comments, including this one, in it.
' @Author Stefan Thoolen <>

Option Explicit

' Converts a "unix timestamp" to a VB6 Date-object
' @param    Double  Timestamp       The seconds since 01-01-1970
' @return   Date                    The real date
' @author   Stefan Thoolen <>
Public Function TimestampToDate(ByVal Timestamp As Double) As Date
    TimestampToDate = DateAdd("s", Timestamp, #1/1/1970#)
End Function