Skip to content

Instantly share code, notes, and snippets.

@dflima
Created November 27, 2012 11:30
Show Gist options
  • Select an option

  • Save dflima/4153790 to your computer and use it in GitHub Desktop.

Select an option

Save dflima/4153790 to your computer and use it in GitHub Desktop.
Convert int to datetime
-- Convert int to datetime with this script.
-- If anyone has a better or a more beautiful method, please, feel free to fork and change it. :)
declare @i as int
select @i = 20121029 --aaaammdd
select convert(datetime, convert(char(8), @i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment