Skip to content

Instantly share code, notes, and snippets.

View jc5577's full-sized avatar

JC jc5577

  • Richmond, VA
View GitHub Profile
@jc5577
jc5577 / sql
Created June 16, 2023 18:51
SQL Server - Convert UTC to another timezone using switchoffset
DECLARE @now DATETIME2 = SYSUTCDATETIME();
SELECT *
,switchoffset(CONVERT(DATETIMEOFFSET, @now), current_utc_offset)
FROM sys.time_zone_info
ORDER BY name
// My son said he knew what #1 and #2 and said vomit was #3.
// I asserted that vomit was #4 because pee and poo together are #3
// so vomit had to be #4. We built out a flag enum and
// his mind is blown. "That makes so much sense!"
[Flags]
enum BodilyExcretions
{
None = 0,
Pee = 1,
Poo = 2,