Announcement

Collapse
No announcement yet.

DateTime and DST problem

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

    DateTime and DST problem

    Unfortunately I have not got any feedback on the issues around DateTime which I reported here. May be because the issues got lost in the noise of that thread. Hence I tool the liberty to create a new thread in order to clear up the issue reports:

    1) constructor not working as expected
    https://dev.deck.net/446906916eb9b1f1dad601ba7967d3b5
    ... yields wrong output
    06/01/2017 01:00:00
    (please disregard the formatting, the wrong value is the complaint)

    Where as
    https://dotnetfiddle.net/be1CUF
    ... yields correct output
    6/1/2017 12:00:00 AM
    2) .ToLocalTime and .ToUniversalTime not working as expected
    https://dev.deck.net/71e23cf19324e01e843df341e5371aa5
    ... results in wrong output
    4
    Whereas
    https://dotnetfiddle.net/9w2tfN
    ... yields correct output
    0

    #2
    geoffrey.mcgill Vladimir Leonid would you mind providing some feedback on the issues above?

    They are getting into our way seriously and I needed to understand:
    1) am I doing something wrong or are these legit issues? If the latter then is there an issue tracking number assigned yet? If not, could there please be one assigned?
    2) in case these are legit issues: what would be the timeframe so they would be addressed?

    Comment


      #3
      The output (.NET and Bridge) depends on time zone of the machine where the code is executed. Formatted is also depends on current culture info.
      For example, for me (local results, on one machine)
      1) .NET - 01.06.2017 0:00:00 (Russian locale)
      Bridge - 06/01/2017 00:00:00 (invariant locale)

      2) .NET - 6
      Bridge - 6

      Comment


        #4
        Vladimir I'm sorry, but your findings are very different than mine

        On 1) no matter to what timezone I set my Windows 10 machine (+ Chrome browser, latest version) I get the results as described in my post #1: timestamps do not match -> wrong

        On 2) same here: it's very clear that Bridge.NET always reports a non-0 value (dependent on timezone I set my machine to) -> wrong
        ... whereas the correct result needed to be "0" and is shown in my browser

        There is something 'fishy' going on under-the-hood (since your results are different than mine) which we needed to understand before moving on

        Please let me know what else we could do to isolate the cause of trouble.

        Thanks

        Comment


          #5
          I just confirmed that I get the exact same (wrong) results from my post #1 when using MS Edge on my Windows10.

          -> these bugs are not browser not timezone dependent

          Comment


            #6
            Just create local console .NET application and try with various time zones. Dotnefiddle is executed on the server (your timezone doesn't affect on server timezone)
            Or try LINQPad for quick checking. So, checking .NET and Bridge functionality should be on the same machine (check .NET locally, not in dotnetfiddle site)

            Comment


              #7
              Vladimir ok, let's focus on issue #1 from my original post in order to get on the same page...

              Here is the simple C# program I ran on my laptop.
              using System;
              
              namespace DateTime
              {
                  class Program
                  {
                      static void Main(string[] args)
                      {
                          Console.WriteLine(new System.DateTime(636318720000000000).ToString());
                          Console.ReadKey();
                      }
                  }
              }
              No matter what timezone I set my laptop to, the result always is:
              6/1/2017 12:00:00 AM
              -> good

              Whereas my deck.net sample https://dev.deck.net/446906916eb9b1f1dad601ba7967d3b5 always (no matter what timezone I set my laptop to) shows:
              06/01/2017 01:00:00
              -> wrong, since the time is 1 hour off

              Can you still not reproduce the issue using my code samples?

              Comment


                #8
                As I wrote previously, my result for your deck sample is `06/01/2017 00:00:00`.

                Also, it can be DST (Daylight Saving Time) problem on your side.
                https://stackoverflow.com/questions/...-in-javascript
                https://stackoverflow.com/questions/...if-it-is-whats

                Unfortunately, DST problem cannot be solved correctly in javascript.

                Comment


                  #9
                  Still trying to understand the full implications of that problem...

                  >> As I wrote previously, my result for your deck sample is
                  Curious: what timezone do you have your PC setup to? I liked to replicate the 'OK' result which you are seeing.

                  Thanks

                  Comment


                    #10
                    UTC +3
                    https://www.timeanddate.com/time/zon...aint-peterburg

                    Comment


                      #11
                      Ah ... now it starts making sense: I'm getting the same results as you after I set my laptop to St.Peterburg/Moscow timezone.

                      Alright, I have to think about how to tackle the DST problem then ...

                      Thanks for your help

                      Comment

                      Working...
                      X