The following allows you to work out the current time on the Unix Environment. The Datediff function is used to work out the number of seconds between 01/01/1970 and the current date.
I have used this against data which is stored and as Unix time.
--Get current Unix datetime SELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE()) as UnixTime Select dateadd(S,
Other resources for T-SQL Dates: