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.
11381 users tagging and storing useful source code snippets
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
Function UnixTime(gmtHrsOffset) UnixTime = DateDiff("s", "1/1/1970 00:00:00", Now()) - (3600 * gmtHrsOffset) End Function Repsonse.Write(UnixTime(-5)) 'E.S.T.
You need to create an account or log in to post comments to this site.