PDA

View Full Version : UK Time


Neil
10-24-2004, 07:41 AM
Hi

Due to the DiscountASP.Net servers being in the US when i call the now() function this returns the US date and time. Ive searched resources on globalization and have come up with no direction to a solution to find the time for the UK so this can be used rather than the US datetime. Has anyone information on this issue.

Regards, Neil

daveyjohn
10-25-2004, 01:50 AM
Hi Neil,

I'm in the UK too. I'd been looking for a solution to a similar problem on one of my own websites.

Have a look at the System.Timezone class. It enables you to work out the timezone that the server is in, whether it's currently under DST or not, and the number of hours that it is offset from GMT.

I haven't really had a chance to have a good look into this, but here are a couple of links I've found that helped me:

www.dotnet247.com/247reference/msgs/25/125287.aspx (http://www.dotnet247.com/247reference/msgs/25/125287.aspx)

www.dotnet247.com/247reference/System/TimeZone/__discussions (http://www.dotnet247.com/247reference/System/TimeZone/__discussions)


Good luck,
Dave

Neil
10-25-2004, 12:11 PM
What i have at the moment can anyone pick any bones out of it. I am using the datetime.utcnow which is returning the GMT time but DST is causing an issue. I havehard coded with


DateTime.UtcNow.AddHours(1)


which does return the UK date and time as we are currently +1DSTbut next week the clocks go back which does not make this very dynamic give or take 2 minutes


Regards, Neil