Quantcast
Viewing all articles
Browse latest Browse all 21093

How to convert UTC date to local time in an alert message


What is the SQL syntax to convert a UTC date/time, such as in the datetime field for a unDP (universal device poller)?  I keep getting:

 

MACRO SQL ERROR - Incorrect syntax near '7'.

for this statement:

Local time:  ${SQL:Select DATEADD(hh,DATEDIFF(hh, GETUTCDATE(), GETDATE()),('''' + ${CustomPollerStatus.DateTime} + ''''))}

 

unDP Taken (UTC time): 11/19/2013 7:45:30 PM

I realize it doesn't like the blank, and I need quote marks around the date so it treats it as an entire string, but I'm having trouble coming up with the right syntax.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 21093

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>