You might have noticed that SQL Server doesn’t have an equivalent of MySQL‘s UNIX_TIMESTAMP()
function.
However, it’s not that difficult to return the Unix timestamp in SQL Server.
The Unix timestamp (also known as Unix Epoch time, Unix time, or POSIX time) is simply the number of seconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC). Therefore, in SQL Server we can use a couple of T-SQL functions to return this.