[MS SQL] Konwersja DATETIME z uwzględnieniem TIME ZONE
Ostatnio zmodyfikowano 2022-01-17 11:01
DejaVu Temat założony przez niniejszego użytkownika |
[MS SQL] Konwersja DATETIME z uwzględnieniem TIME ZONE » 2022-01-17 11:01:54 Przykład: SELECT EventDT AT TIME ZONE 'Central European Standard Time' AT TIME ZONE 'UTC' AS LocalToUtc, EventDT AS UnkownZone, EventDT AT TIME ZONE 'UTC' AT TIME ZONE 'Central European Standard Time' AS UtcToLocal FROM ( SELECT CAST('2021-01-01 10:00:00' AS DATETIME) AS EventDT UNION ALL SELECT CAST('2021-03-01 10:00:00' AS DATETIME) AS EventDT UNION ALL SELECT CAST('2021-04-01 10:00:00' AS DATETIME) AS EventDT UNION ALL SELECT CAST('2021-09-01 10:00:00' AS DATETIME) AS EventDT UNION ALL SELECT CAST('2021-10-01 10:00:00' AS DATETIME) AS EventDT UNION ALL SELECT CAST('2021-12-01 10:00:00' AS DATETIME) AS EventDT ) AS Tmp
|
|
« 1 » |