Skip to content

Instantly share code, notes, and snippets.

@zachbonham
Created March 13, 2015 21:53
Show Gist options
  • Save zachbonham/4e761f1af237c16dd5bc to your computer and use it in GitHub Desktop.
Save zachbonham/4e761f1af237c16dd5bc to your computer and use it in GitHub Desktop.
NEW_TIMESTAMP
CREATE FUNCTION NEW_TIMESTAMP()
RETURNS int
AS
BEGIN
DECLARE @epoch INT;
SELECT @epoch = DATEDIFF(SECOND, {d '1970-01-01'}, GETUTCDATE())
RETURN @epoch;
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment