Last active
December 14, 2015 21:09
-
-
Save fcojperez/5149520 to your computer and use it in GitHub Desktop.
Función para la Conversión Unix Time/POSIX time a Fecha en Transact-SQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
FUNCTION [UTC2Date]: Para convertir la hora UTC en hora local | |
PARAEMTROS: | |
@date: número de segundos desde '1970-01-01' | |
*/ | |
CREATE FUNCTION [UTC2Date] (@date int ) | |
RETURNS datetime | |
BEGIN declare @NewDate datetime | |
set @NewDate = DATEADD([second], @date, ’1970-01-01′) | |
RETURN @NewDate | |
END; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment