Announcement

Collapse
No announcement yet.

Weird long dates in Windows XP

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

  • Weird long dates in Windows XP

    Maybe you've experienced it already. In my opinion Windows XP returns weird long calendar dates for Cataluña (Spain) and Sweden.

    This is what GetDateFormat (Windows API) returns as the long date for Cataluña: dimecres, 27 / febrer / 2008 (Wednesday, February 27, 2008), so with a forward slash, which is the separator for the short date. I think, it should return: dimecres, 27 de febrer de 2008. And when the name of the month starts with a vowel, it should be (for instance): dilluns, 27 d'octubre de 2008.

    And here comes what Windows XP returns for the Swedish long date: den 27 februari 2008. But in almost every online Swedish newspaper I find dates that include the name of the day, instead of the word "den", for instance: onsdag 27 februari 2008.

    There are a few possibilities:
    1. Windows is simply wrong
    2. Windows is correct, but old-fashioned
    3. These bugs appear only in the Dutch language version of WinXP


    Comments from Swedish and Catalonian/Spanish programmers are very welcome. You may want to test it, running the code below:

    Code:
    #INCLUDE "WIN32API.INC"
    
    FUNCTION PBMain() AS LONG
      LOCAL szDate AS ASCIIZ * 64, st AS SYSTEMTIME
      LOCAL sText AS STRING
      
      GetLocalTime st
      GetDateFormat 1027, %DATE_LONGDATE, st, "", szDate, SIZEOF(szDate)
      sText = REMOVE$(szDate, CHR$(0)) & $CRLF
      GetDateFormat 1053, %DATE_LONGDATE, st, "", szDate, SIZEOF(szDate)
      sText = sText & REMOVE$(szDate, CHR$(0))
      MSGBOX sText, 64, " Date testing..."
    END FUNCTION
    Last edited by Egbert Zijlema; 27 Feb 2008, 08:52 AM. Reason: adding code

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

  • #2
    Maybe you've experienced it already....eird long calendar dates for Cataluña (Spain) and Sweden.
    Egbert, this will no doubt be the shortest "Yes, me too!" list in recorded history.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Which means...

      Which means that it is not going "wrong" in the Dutch language version of Windows XP alone.

      But the main question is: is it really wrong and if so, why did Microsoft not change it for years? As far as I can remember the long-date-with-short-date-separator for Cataluña did already exist in Win95.
      [Did they repair it recently in Vista, perhaps? Question: who is willing to try my above code under Vista? Thanks in advance.]

      Well, right or wrong, it is strange. Speaking for myself, I trust the Catalonian and Swedish newspapers more than Microsoft programmers, so I'm going to modify the GregDateFormat function in my Gregorian Day Library again, in order to "produce" correct long dates for both regions, Cataluña (already implemented) and Sweden.

      Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
      http://zijlema.basicguru.eu
      *** Opinions expressed here are not necessarily untrue ***

      Comment


      • #4
        Egbert,

        I'm running Windows Vista Home Premium (English, USA) and I see the same thing you are, so it's still the same.

        Comment


        • #5
          This could simply be a usage issue. For example, in a german letter head you will often find dates written like

          Donnerstag, den 28. Februar 2008

          Whereas the long date format only is

          Donnerstag, 28. Februar 2008

          Just guessing here, but who knows. In general, MS translations are of good quality (judging from their german versions), so I somewhat doubt that they kept this error since Win95

          Comment


          • #6
            Hello Knuth,

            Obviously you are talking about the Swedish long date. It is possible that "den 27 februari 2008" is correct in the same way "den" is used in your German example ("vierten Fall", if I'm correct?). But I never have seen it on the frontpages of the Swedish newspapers; they always use the name of the day, without "den" in between.
            And what about the Catalonian long date, with its weird short-date-separator? Again, see the newspapers to find that the word "de" is used instead of the forward slash.

            Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
            http://zijlema.basicguru.eu
            *** Opinions expressed here are not necessarily untrue ***

            Comment


            • #7
              Hate to say it, but you are limited to the programmer that wrote the function.
              you could be running into (the programmer that did the original is no longer the current programmer, or a "translation" of a function, or the programmer that wrote the function not knowing enough of each language to code it right)

              More or less like me going overseas (I will use Germany and England for this example)

              I know enough deutsche to get around (as long as who I am speaking to can understand my "broken-english" and dialect) and I would THINK I know enough English to get around England but as the next phrase will show

              "Ya'll get im der Truck, We're headen up to dah big house (haus)"

              How many usages of dialects can you find there? (god even I don't know)

              So in this case "THANK GOD" its only computers involved, but I think you will have to check the locale settings (and operating systems) of the computer to show the correct date

              Its a minor pain, but I feel for you as I too have run into this from time to time
              Engineer's Motto: If it aint broke take it apart and fix it

              "If at 1st you don't succeed... call it version 1.0"

              "Half of Programming is coding"....."The other 90% is DEBUGGING"

              "Document my code????" .... "WHYYY??? do you think they call it CODE? "

              Comment


              • #8
                GetDateFormat() will allow you to create any format... maybe it will let you get rid of the spurious "den" of which you speak.

                The doc does not say if the month and day names are in "local-ese" but this has got to be worth a try, at least for the language(s) giving you fits. (I would think the local language would be used).

                Here's a starter program (and that's all it is)...
                SQL Escaped Date, Time, Timestamp functions Demo
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Force any fomat?

                  Yes, you can force any format, using the option lpFormat and (at the same time) set dwFlags to zero. The only problem is, that I do not necessarily know how an abroad long date should be formatted. Unless I use the "date picture" (GetLocaleInfo etc...), but that tells me to use (for instance) a forward slash in a Catalonian long date. Get the (date) picture?

                  That's why I prefer to leave it to Windows, assuming it's correct. But that is likely a wrong assumption.

                  Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                  http://zijlema.basicguru.eu
                  *** Opinions expressed here are not necessarily untrue ***

                  Comment


                  • #10
                    Reply to Cliff Nichols

                    Cliff,

                    We are not talking about a human programmer (who maybe dead, in the meantime) but a company called Microsoft. And yes, it is about probably wrong system settings. So checking the system does not make sense here.

                    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                    http://zijlema.basicguru.eu
                    *** Opinions expressed here are not necessarily untrue ***

                    Comment


                    • #11
                      MOST WANTED: Swedish and Catalonian programmer!

                      This is an interesting discussion, but so far it is not very helpful.

                      I was hoping, both, a Swedish and a Catalonian programmer (or a Spanish one with knowledge of the Catalan language), would join in to speak the definite word of wisdom on this subject. What I want to know is whether the date formats provided by MS are correct or wrong.

                      Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                      http://zijlema.basicguru.eu
                      *** Opinions expressed here are not necessarily untrue ***

                      Comment


                      • #12
                        The dates using the Catalan locale are incorrect. We don't use backslashes.
                        Forum: http://www.jose.it-berater.org/smfforum/index.php

                        Comment


                        • #13
                          Gracias!

                          Thank you, José!

                          One additional question. What happens when Catalonian users set their computer's Regional Settings for Cataluña? Do they get a wrong long date too? And if so, did and do they complain, or do they silently set a user override? And all those years MS never corrected this blunder...

                          Okay, I'm waiting for the final Swedish answer now, although I think I can guess it.

                          Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                          http://zijlema.basicguru.eu
                          *** Opinions expressed here are not necessarily untrue ***

                          Comment


                          • #14
                            What happens when Catalonian users set their computer's Regional Settings for Cataluña? Do they get a wrong long date too?
                            Yes.

                            And if so, did and do they complain, or do they silently set a user override?
                            Don't know what others do, but it is quite easy to write a function to get the output right. The quickest way is just to remove the backslashes.
                            Forum: http://www.jose.it-berater.org/smfforum/index.php

                            Comment


                            • #15
                              Originally posted by José Roca
                              Don't know what others do, but it is quite easy to write a function to get the output right.
                              To write a function? If you are a programmer it's a piece of cake, indeed. But what do "average" users do? They cannot write functions. Perhaps they make a so called user override under Regional Settings? Anyway, it's very bad that MS did not repair this for such a long time.

                              Okay, so far Catalunya. Now, what about Sweden? Is there a Swedish programmer who can tell something useful about the "den" long date? Is it correct but a bit old-fashioned or is it simply wrong?

                              Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
                              http://zijlema.basicguru.eu
                              *** Opinions expressed here are not necessarily untrue ***

                              Comment

                              Working...
                              X