NEWS & TECH BLOG
GoldSync and server time
21/09/2015 – in GoldMine, Issues, SQL queriesRecently a customer had a problem where GoldSync was randomly not synchronising various items. This can sometimes happen when one or both GoldSync machines is set to the wrong time.
In this case, both of them said that they were set correctly when interrogated through the Windows GUI. However, one of them was actually telling us porkies, as we found by interrogating the SQL server.
The query that we used came from http://dba.fyicenter.com/faq/sql_server/Difference_Between_GETDATE_and_GETUTCDATE.html.
DECLARE @local_time DATETIME;
DECLARE @gmt_time DATETIME;
SET @local_time = GETDATE();
SET @gmt_time = GETUTCDATE();
SELECT 'Server local time: '
+ CONVERT(VARCHAR(40),@local_time);
SELECT 'Server GMT time: '
+ CONVERT(VARCHAR(40),@gmt_time);
SELECT 'Server time zone: '
+ CONVERT(VARCHAR(40),
DATEDIFF(hour,@gmt_time,@local_time));
This showed the the server was actually way off. We suspect that it was to do with setting the time via RDP rather than directly on the server itself.
The moral of the tale is to not always believe what Windows tells you!