Convert historic dates from utc to local time

Posted by Espo on Stack Overflow See other posts from Stack Overflow or by Espo
Published on 2010-05-20T10:16:41Z Indexed on 2010/05/20 10:20 UTC
Read the original article Hit count: 209

Filed under:
|
|
|

I have an sql table with data like this:

| theDate (datetime)  | theValue (int) |
----------------------------------------
| 2010-05-17 02:21:10 |              5 |
| 2009-03-12 04:11:35 |             23 |
| 2010-02-19 18:16:53 |             52 |
| 2008-07-07 22:54:11 |             30 |

The dates are stored in UTC format in a datetime column, how can I convert them to local time (Norway)? Remember that the UTC-offset is not the same all year because of winter/summer-time.

© Stack Overflow or respective owner

Related posts about sql

Related posts about datetime