Converting Remedy date/time into SQL Server timestamp

How to get the current epoch time in SQL Server? – use this command

SELECT DATEDIFF(s, ‘1970-01-01 00:00:00’, GETUTCDATE())

In order to apply it to a Remedy statement you have to replace the GETUTCDATE() with a remedy field and you’ll obtain the following statement

SELECT DATEDIFF(s, ‘1970-01-01 00:00:00’, ‘$Last Modified Date$’)

In this way you’ll get the current epoch time for SQL server that could be inserted or update directly into the database.

Leave a Reply