UK Time

Discussion in 'ASP.NET / ASP.NET Core' started by Neil, Oct 24, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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
     
  2. 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

    www.dotnet247.com/247reference/System/TimeZone/__discussions


    Good luck,
    Dave
     
  3. 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
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page