tags:

views:

183

answers:

3

I have a datetime column in a table called 'createdDate' were the default value is set to getutcdate(). However when a row is added to the table the createdDate's time value is 1 hour behind the system time. So my question is how do I increase the current database system timestamp by 1 hour?

Thanks in advance.

+2  A: 

It sounds like your servers are aware of daylight saving (GMT, BST and so on), and your database is resolutely using UTC.

Use GetDate() if you want your dates in the database to match the database server's time.

Alternatively, uncheck the box to "automatically adjust clock for daylight saving changes" in the Date and Time properties on your server and continue to use GetUtcDate().

Paul Suart
A: 

The database server is probably in a time zone that has a one hour offset from UTC time. Take a look at the MSND entries for GetDate() and GetUtcDate(), respectively.

Eyvind
A: 

You should always ensure that your server and your DB agree on timezones and DST changes.

IMO you should always settle on UTC, since that insulates you from any subtle errors as a result of disparate DST changes (such as what happened in the US last year).

Visage