标签:
DECLARE
@LocalDate DATETIME,
@UTCDate DATETIME,
@LocalDate2 DATETIME
SET
@LocalDate = GETDATE()
SET
@UTCDate = DATEADD(
hour
, DATEDIFF(
hour
,GETDATE(),GETUTCDATE()), @LocalDate)
SET
@LocalDate2 = DATEADD(
hour
, DATEDIFF(
hour
,GETUTCDATE(),GETDATE()), @UTCDate)
SELECT
‘1. Now‘
[Now], @LocalDate [DateTime]
UNION
SELECT
‘2. UTC‘
, @UTCDate
UNION
SELECT
‘3. Now again‘
, @LocalDate2
标签:
原文地址:http://www.cnblogs.com/lsysunbow/p/5669040.html