Custom format in DateTimePicker

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guy Corriveau

    Custom format in DateTimePicker

    Got a dateTimePicker o

    o.Format = DateTimePickerF ormat.Custom;

    o.CustomFormat = "MM/dd/yyyy hh:mm tt";

    the previous code work well when the Regional option is set to english
    Canadian but do not display the AM or PM when the Regional option is set to
    french canadian


  • Cor Ligthert

    #2
    Re: Custom format in DateTimePicker

    Guy,

    I am curious because in my opinion is the behaviour more than correct.

    Is in French Canadian the PM and AM used and what does it than mean in the
    French language?

    You can use very terrible constructions by setting the culture of the UI in
    the constructor. However, I find that terrible because that is not changeble
    than in anyway and really is your application than fixed for one culture.
    You have to do that for the base class as well when you inherit your forms.

    Maybe this helps

    Cor


    Comment

    • Cor Ligthert

      #3
      Re: Custom format in DateTimePicker

      doh,

      I think I make a mistake, because I thought that for the DateTimePicker even
      that changing in the constructor does not work.

      Cor


      Comment

      • gerry

        #4
        Re: Custom format in DateTimePicker

        ok - so what does AM / PM mean in any language other than latin ?





        "Cor Ligthert" <notmyfirstname @planet.nl> wrote in message
        news:%235tKCQlH FHA.3196@TK2MSF TNGP15.phx.gbl. ..[color=blue]
        > Guy,
        >
        > I am curious because in my opinion is the behaviour more than correct.
        >
        > Is in French Canadian the PM and AM used and what does it than mean in the
        > French language?
        >
        > You can use very terrible constructions by setting the culture of the UI[/color]
        in[color=blue]
        > the constructor. However, I find that terrible because that is not[/color]
        changeble[color=blue]
        > than in anyway and really is your application than fixed for one culture.
        > You have to do that for the base class as well when you inherit your[/color]
        forms.[color=blue]
        >
        > Maybe this helps
        >
        > Cor
        >
        >[/color]


        Comment

        • Guy Corriveau

          #5
          Re: Custom format in DateTimePicker

          In fact, the interface of the software in working on, can be display in
          french or English on a Click, and I made custom setting on the
          datePicker to be sure, if the software is use in french the datePicker
          will be in french, if the software is use in english the datePicker will
          display date in english format.

          When i try the code,
          I put the regional setting in english
          Software in engish display
          the date picker display in english 12/01/2005 10:00 PM
          software in french display
          the date picker display in french 01-12-2005 22:00

          I put the regional setting in french
          Software in engish display
          the date picker display in english 12/01/2005 10:00
          software in french display
          the date picker display in french 01-12-2005 22:00






          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Cor Ligthert

            #6
            Re: Custom format in DateTimePicker

            Guy,

            One word, it is not the English format.

            That is the language, what you are using is the US or English Canada culture
            for date and time and the standard French way for that.

            In most English speaking countries is the English way of datetime used.

            See this page from the BBC I think it cannot be more English than that.

            The best of the BBC, with the latest news and sport headlines, weather, TV & radio highlights and much more from across the whole of BBC Online


            I hope this helps

            Cor


            Comment

            • Guy Corriveau

              #7
              Re: Custom format in DateTimePicker

              December the 31 2004 at 10:00 PM

              Why in this case the display show
              with string to custom format "MM/dd/yyyy hh:mm tt"
              12/31/2004 10:00 PM regional setting in english
              12/31/2004 10:00 regional setting in french

              and "dd-MM-yyyy HH:mm"
              31-12-2004 22:00 regional setting in english
              31-12-2004 22:00 regional setting in french



              *** Sent via Developersdex http://www.developersdex.com ***
              Don't just participate in USENET...get rewarded for it!

              Comment

              • Cor Ligthert

                #8
                Re: Custom format in DateTimePicker

                Guy,

                Because you did hard coded your format, in my opinion something nobody
                should ever do.

                But you can use the short words as in this case probably the best is the
                standard ()
                string st = dt.ToString()

                See here the posibilities on that


                I hope this helps?

                Cor


                Comment

                Working...