Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @ticksPerDay BIGINT = 864000000000 -- DO NOT CHANGE
- DECLARE @date DATETIME
- DECLARE @triggerName varchar(300)
- --####### set the source date value here ########
- SET @date = GETUTCDATE() --put here UTC date
- SET @triggerName = 'triggerName'
- --#####################################
- DECLARE @date2 DATETIME2 = @date
- DECLARE @dateBinary BINARY (9) = cast(reverse(cast(@date2 AS BINARY (9))) AS BINARY (9))
- DECLARE @days BIGINT = cast(substring(@dateBinary, 1, 3) AS BIGINT)
- DECLARE @time BIGINT = cast(substring(@dateBinary, 4, 5) AS BIGINT)
- DECLARE @nextFireTime bigint = @days * @ticksPerDay + @time
- SELECT @date AS [DateTime]
- ,@nextFireTime AS [Ticks]
- ,CAST((@nextFireTime) / 864000000000.0 - 693595.0 AS DATETIME) + (GETDATE() - GETUTCDATE()) as [CheckDate] --local time (for SQL SERVER)
- UPDATE QRTZ_TRIGGERS
- SET NEXT_FIRE_TIME = @nextFireTime
- WHERE TRIGGER_NAME= @triggerName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement