locked
Azure Website Server Time RRS feed

  • Question

  • Hi,

    I published an application to the azure website located WestEurope.

    I searched for the datacenter and I read that it is located in Amsterdam. Amsterdam has Timezone GMT+1. I am in Austria and here it is the same, but if I do something on server site in my code I have GMT as Timezone.

    Maybe the WestEurope Datacenter is not located in Amsterdam? Where is the NorthEurope Datacenter?

    What can I do with Lightswitch to change the time to GMT+1 instead of GMT? I do not like to change my code everywhere I use the server time.

    Thanks.

    Markus

    Friday, February 22, 2013 8:18 AM

Answers

  • Actually no, I didn't mean a UDF, although I suppose you could do that. I don't usually recommend that anyone use Views, or any other T-SQL, unless it's an attached data source, or the user is VERY knowledgeable about SQL Server & there's no other way.

    I meant add a function (in code) to a Module (in VB, or in a static class in C#) in the Common project's UserCode folder (or in the case of LS 2012, in the Server project's UserCode folder)


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Marked as answer by Dragonalw Saturday, March 2, 2013 7:55 PM
    Sunday, February 24, 2013 12:45 PM
    Moderator

All replies

  • Hello Markus,

    In all MS datacenter around the world you always have UTC as "local time" on the virtual machine; on every Windows and every SQL Azure server.


    Olaf Helper

    Blog Xing

    Friday, February 22, 2013 8:27 AM
  • I'd suggest that you write a wrapper function around your call to get the server time, & call that instead of getting the time directly. That way, you only need to make any changes (now, or in the future) in one place, instead of many.

    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    Friday, February 22, 2013 12:23 PM
    Moderator
  • Hi,

    thanks for the answers.

    @Olaf: Really good to know that.

    @Yann: You mean that I have something like my own now function on my server code? Maybe you can give me a tip how to do something like that?

    Thanks.

    Markus

    Saturday, February 23, 2013 9:28 AM
  • Markus,

    I guess Yann means a UDF = user defined function on SQL Azure side, like:

    CREATE FUNCTION dbo.MyGetDate() 
       RETURNS datetime
    AS
    BEGIN
        RETURN (SELECT DATEADD(hour, +2, GetDate()));
    END;
    GO
    
    
    SELECT dbo.MyGetDate()

    It add's 2 hours to the local UTC time and returns this value.

    Olaf Helper

    Blog Xing

    Sunday, February 24, 2013 12:02 PM
  • Actually no, I didn't mean a UDF, although I suppose you could do that. I don't usually recommend that anyone use Views, or any other T-SQL, unless it's an attached data source, or the user is VERY knowledgeable about SQL Server & there's no other way.

    I meant add a function (in code) to a Module (in VB, or in a static class in C#) in the Common project's UserCode folder (or in the case of LS 2012, in the Server project's UserCode folder)


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Marked as answer by Dragonalw Saturday, March 2, 2013 7:55 PM
    Sunday, February 24, 2013 12:45 PM
    Moderator