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:
' http://www.stefanthoolen.nl/archive/vb6-functions/
' 
' You may freely distribute this file but please leave all comments, including this one, in it.
' 
' @Author Stefan Thoolen <mail@stefanthoolen.nl>

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 <mail@stefanthoolen.nl>
Public Function TimestampToDate(ByVal Timestamp As Double) As Date
    TimestampToDate = DateAdd("s", Timestamp, #1/1/1970#)
End Function