DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Steve has posted 12 posts at DZone. View Full User Profile

Unix Time

  • submit to reddit
Function UnixTime(gmtHrsOffset)
	UnixTime = DateDiff("s", "1/1/1970 00:00:00", Now()) - (3600 * gmtHrsOffset)
End Function

Repsonse.Write(UnixTime(-5)) 'E.S.T.

Adding in the GMT offset allowed this to match PHP's time() function on a separate server.