I use a timestamp as part of my application, the problem being however that timestamps created in Javascript and SQL Server at the same time show different values. They run on the same computer, so the system clock isn't an issue.
Javascript:
var now = new Date();
console.log( new Date(now.getUTCFullYear(),
now.getUTCMonth(),
now.getUTCDate(),
now.getUTCHours(),
now.getUTCMinutes(),
now.getUTCSeconds()).valueOf() /1000);
SQL Server 2012:
SELECT datediff(second,'1970-01-01 00:00:00.000',getutcdate())
Could it be that the first part of the datediff argument, isn't interpreting 01/01/1970 in UTC?
To test, I executed the javascript in jsfiddle, and rand the SQL in management studio, within 1-2 seconds of each other.
Results: Javascript: 1339348299 SQL Server: 1339384301
So there's a difference of 36002 seconds, or 10 hours, which is my timezone offset.