<p>I have a problem with time<br>
My server is in the USA and I'm in Denmark (Europa) and I would like to have my site show the time in my local time.  How can I do that?</p>

<p>I try this  </p>

<pre><code>Datetime localtime = DateTimeOffset.Now.ToOffset(new TimeSpan(1,0,0)).DateTime;
</code></pre>

<p>and it works, but it will only work when I'm in GMT+1 / UTC+1 and not when I'm in GMT+2 / UTC+2.
Is there another way of doing this - a simpler way of doing it?</p>

You can get the time off the server and do this.
```
```
DateTime myTimeGMT = ServerTime.ToUniversalTime();
```
```
This do this:
```
```
DateTime myTimeLocal = myTimeGMT.ToLocalTime();
```
```
The only restriction here is the computer you are on must be set to the time zone you are converting to.
In my experience, .NET has trouble converting between timezones when neither the 'From' time or the 'To' time are the local time zone.
I hope this helps.