Announcement

Collapse
No announcement yet.

System.DateTime on MASTER not working correctly with timezones

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    System.DateTime on MASTER not working correctly with timezones

    I can't provide a Deck.NET sample due to this bug: https://forums.bridge.net/forum/brid...r-offset-issue

    Here the code to reproduce (note: I have set my local PC to Casablanca timezone for that test):
    new DateTime(636318720000000000).ToString()
    Expected output:
    "01.06.2017 00:00:00"
    Actual output:
    "05/31/2017 23:00:00"
    Pls disregard any formatting issues. The relevant part is the actual date/time value. Thanks

    #2
    Here is another example the timezone handling in System.DateTime is completely screwed up:

    new DateTime(636318720000000000L).ToLocalTime().Subtract(new DateTime(636318720000000000L).ToUniversalTime()).TotalHours.ToString()
    If I set my PC to Moscow timezone I get an output of "6", which is wrong, since Moscow is not 6 hours ahead of UTC.

    Comment


      #3
      Good Morning DierkDroth have you tried using https://dev.deck.net/ - this is the current build.

      https://dev.deck.net/151f5e40c7c1b2a695758f376db9ad0c It seems the top example is fixed.

      Just wondering if you would like to test the second issue on dev.deck.net :)

      Comment


        #4
        Poking
         
         new DateTime(636318720000000000L).ToLocalTime().Subtract(new DateTime(636318720000000000L).ToUniversalTime()).TotalHours.ToString();
        ... into Deck.NET does not show any result at all.

        Not sure what other is causing that now...

        Comment


          #5
          DierkDroth – Please share a link to a Deck.NET (dev) sample demonstrating how to reproduce.

          Comment


            #6
            https://deck.net/adff9a63d84aeefec8461ae1e8f9ff8e

            Comment


              #7
              What exactly are you expecting that sample to do?

              Comment


                #8
                Pls try this link and set your PC local timezone to Moscow time before:
                https://deck.net/ede5fe2463590c81b370728ea0a328e8

                The output of "6" is incorrect, since it does not correctly reflect the offset between Moscow timezone and UTC, which is 3 hours.
                Last edited by DierkDroth; 2017-04-05 @ 06:42 AM.

                Comment


                  #9
                  Originally posted by DierkDroth View Post
                  I'm expecting an output in the 'Result' column ... there is none at this point.
                  There is no result in the Result panel because you do not output anything to the Document or Bridge.Console.

                  From what I can tell, the sample you provided appears to be working as expected.

                  Comment


                    #10
                    Cross edits ... pls see my edited post

                    Comment


                      #11
                      Originally posted by samuelgrahame View Post

                      https://dev.deck.net/151f5e40c7c1b2a695758f376db9ad0c It seems the top example is fixed.
                      samuelgrahame curious: how to you manage to switch between 'official' Deck.NET 15.7.0 and the version you had been using which runs on a particular commit?

                      Comment


                        #12
                        im not sure how to run non master branches, but if you clone and build there project you can build your project using that, i just found out about dev deck website, it runs a branch from there git.

                        Comment


                          #13
                          Understand

                          Comment


                            #14
                            geoffrey.mcgill Leonid I just checked: dev.deck.net exhibits the same issue. Is this an acknowledged bug or am I doing something wrong?
                            Last edited by geoffrey.mcgill; 2017-06-30 @ 10:25 PM.

                            Comment


                              #15
                              Follow up on this thread https://forums.bridge.net/forum/brid...nd-dst-problem
                              Last edited by Leonid; 2017-05-29 @ 09:56 PM.

                              Comment

                              Working...
                              X