locked
Windows 7 and DateTimePicker control? RRS feed

  • Question

  • Hello,

    I have just installed Windows 7 RTM and I have set Region and Language to
    Hebrew so shorts dates are in the format of dd/MM/yyyy.

    Problem is that when using DateTimePicker control on Windows Form
    application using VS.NET 2008 SP1 the date is shown as yyyy/MM/dd instead of
    dd/MM/yyyy.

    I have compiled a test app with DateTimePicker and dates are shown as should
    be on PC's that runs XP and Windows server 2008.


    Thanks in advanced for any help,
    Asaf

    • Changed type nobugz Wednesday, October 14, 2009 3:11 PM unresolved
    • Changed type nobugz Wednesday, October 14, 2009 3:12 PM unresolved
    • Changed type Rudedog2 Sunday, October 31, 2010 8:57 PM Possible Solution Found by Hans Passant
    Friday, August 21, 2009 5:25 AM

Answers

  • Hello All,

    After posting this bug to Microsoft support all credits belongs to Mr. Ron Stock who did everything in order to bring this bug to fix with KB 2030901

    http://support.microsoft.com/kb/2030901

     

    Kind Regards,

    Asaf

    • Marked as answer by nobugz Tuesday, November 2, 2010 2:52 AM
    Thursday, June 24, 2010 11:07 AM

All replies

  • Hi Asaf,

     

    Welcome to MSDN Forums!

     

    Thank you so much for reporting this issue.  I can reproduce this potential issue in both Windows 7 RTM and RC systems at my side.  I will consult it to the product team for further investigation and keep you informed as soon as I receive any feedbacks.  

     

    Thank you very much for you patient & have a nice weekend!

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by asafgo Friday, August 21, 2009 1:19 PM
    • Unmarked as answer by nobugz Wednesday, October 14, 2009 3:11 PM
    Friday, August 21, 2009 10:24 AM
  • Hi and Welcome to MSDN Forums, I think
    my information might help you.

    Hmm? This is a interesting problem.
    I am running Windows 7 Beta, and I have the following DateTimeFormat = MM/dd/yy, in my DateTimePicker control,
    its set as default.

    I think that the default format comes directly from the control panel settings, from the Regional and Language settings in Windows 7.

    These formats are for English (United States):
    Short date: M/d/yyyy
    Long date: dddd, MMMM dd, yyyy

    Check some settings and see if you can fix it...

    In my  PC everything works fine, and I run VS2008 + SP1...

    I hope this information was helpful...

    Have a nice day...

    BTW, what time & date format do you have as current on your PC?

    Best regards,
    Fisnik

     
    Coder24.com
    • Edited by Fisnik Hasani Friday, August 21, 2009 11:56 AM added: I hope this information was helpful...
    Friday, August 21, 2009 11:55 AM
  • This is a common problem with DTP.  The problem is that there are two distinct places where culture info are stored, Windows and the .NET framework.  They don't always agree, culture support in .NET is much richer than the what's available in Windows.  DTP is a native Windows control, it doesn't know anything about .NET cultures.  Format mismatches are the result.

    First thing you should try is to set the system language to Hebrew as well.  The next workaround is to use the custom format option available in DTP.

    Hans Passant.
    Friday, August 21, 2009 12:57 PM
  • Hello Fisnik & Hans,

    Problem with formatting is just in the Hebrew Region and Language where (Hans) all settings are set to Israel and Hebrew.
    When using US (Fisnik) there is no problem but I would like to use Israel/Heberw.

    Also from my side this problem is only on Windows 7 as my application written in C#.NET is working with the correct DateTime format in any version of Windows XP and Windows Vista so again I see it as a problem related to Windows 7.

    Thanks you all for your replies and I hope we will have a Windows 7 Update for this issue.


    Kind Regards,
    Asaf
    Friday, August 21, 2009 1:19 PM
  • Hi Asaf:

    In fact, there's a solution you can implement, and it's customized code support with C#.
    Take a look at my code analysis below:


    Figure A: The "DateTime.Now" part returns the following value "{8/21/2009 7:52:57 AM}", since we have
    not chosen to convert it to a shorter date format. But as we can see the format is in U.S. = "M/dd/yyyy". 

    Now my solution can be seen if we move the cursor over the "date" string variable (See Figure B, below).


    Figure B: The string variable "date" will return the following DateTime value "21/08/2009", which is in the 
    Hebrew DateTime format, like the one you posted: "dd/MM/yyyy", of course short time.  

    I hope this information was helpful...

    Have a nice day...

    Best regards,
    Fisnik
     
    Coder24.com
    Friday, August 21, 2009 4:40 PM
  • Hello Fisnki,

    The problem with DateTimePicker is a GUI display not a functioning problem as you can see at the picture where it should be display like "21/08/2009".

    Kind Regards,

    Asaf

    Friday, August 21, 2009 9:01 PM
  • Hi Asaf:

    Yes, the problem is [...], I understand that, but the point is that exactly the same solution applies to
    the DateTimePicker control.

    I'll explain, from the DateTimePicker properties you have two different properties wich,
    can by a change by a mouse click and, will make this work.

    DateTimePicker properies: 

    this.dateTimePicker1.Format = DateTimePickerFormat.Custom;
    this.dateTimePicker1.CustomFormat = "dd/MM/yyyy";


    The result: 


    Figure A: A DateTimePicker using custom dateTime format. 

    I hope this information was helpful...

    Have a nice day...

    Best regards,
    Fisnik 


    Coder24.com
    Saturday, August 22, 2009 6:46 AM
  • Hi Fisnik,

    I have already tried CustomFormat but still no luck when using Regional and Language for Hebrew/Israel Region.

    Also my production application is working just fine with XP and Vista so I see this issue as a bug in Windows 7.

    Kind Regards,
    Asaf

    Saturday, August 22, 2009 5:55 PM
  • Hi Asaf:

    The screenshot I made is in Windows 7 Beta 1.
    Since I only have VS2008 and Windows 7 on my school PC.

    But it works fine for me in Windows 7....

    Have a nice day...

    Best regards,
    Fisnik
    Coder24.com
    Saturday, August 22, 2009 7:47 PM
  • Hi Fisnik,

    Many thanks for trying to help, I suggest we will leave this issue to be solved by Windows 7 developers team.

    Kind Regards,
    Asaf
    Saturday, August 22, 2009 8:52 PM
  •  

    Hi Asaf,

     

    This is a quick note to inform you that he product team is investigating the issue to check the root cause is at the native DataTimePicker side or at the .NET Framework side.   I will let you know any updated information.  Thank you for your patient!

     

    Have a nice day!

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, August 31, 2009 7:24 AM
  • Hello Lingzhi,

    Any news from product team regarding this problem please?

    Kind Regards,
    Asaf
    Tuesday, September 1, 2009 10:27 AM
  •  

    Hi Asaf,

     

    I am connecting the product team by email.  Several senior developers are investigating the issue and they found it is related to several other known issues.   I will keep you informed about any updated news.   Thanks for your patient!

     

    Have a nice day!

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by asafgo Saturday, September 5, 2009 5:55 AM
    • Unmarked as answer by nobugz Saturday, September 5, 2009 7:36 PM
    Wednesday, September 2, 2009 2:57 AM
  • Hello Lingzhi,

    Any news regarding this issue please as Windows 7 is going to market in about 8 days and all users that are using applications written in .NET on Windows 7 configured to use Hebrew dates format will suffer from this issue.

    I would like to know if and when a fix for this issue will be available please?

    Kind Regards,

    Asaf

    Wednesday, October 14, 2009 2:39 PM
  • Hi Asaf,

    Unfortunately, I do not receive any updated information from the product team.  If this issue is really urgent, please go to http://support.microsoft.com/ for support.  Since this problem should be a product issue, the professional support would be free. 


    Hope you have a nice day!

    Best Regards,
    Lingzhi Sun
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

    Wednesday, October 14, 2009 2:55 PM
  • Hi Asaf,

    By the way, if the support engineer at http://support.microsoft.com/ needs some additional information, you can give them my email address: v-micsun @ microsoft.com.  I am glad to give a hand. 


    Best Regards,
    Lingzhi Sun
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, October 14, 2009 3:00 PM
  • Hello Lingzhi,

    Thanks for your advice but I am not going to waste my time messing around with support.
    This is a known issue acknowledged by Windows 7 developer's team to you and I am expecting from Microsoft to release an update to this issue before Windows 7 is in the market as there are many many applications written in .NET for Hebrew/Israel and a lots of users and developers will suffer from this issue.


    Kind Regards,

    Asaf

    Thursday, October 15, 2009 3:17 PM
  • Hi Asaf,

     

    I can understand the issue is annoying.  I have done my best to retrieve some updated information from the product team.  Unfornately, in Windows 7 RTM, this issue won't be fixed.  Because this problem is very complicated and related to several other issues. 

     

    Hope you can understand. 

     

    Thanks again & Have a nice day!

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, October 19, 2009 10:08 AM
  • Hello Lingzhi,

    Does Windows 7 RTM is different from Windows 7 that is going to ship to market on 22 October 2009 and does this problem will not appear in that version like it does now in the Windows 7 RTM?

    Does Windows 7 RTM will have an update for this problem or no update will be available and will require a clean install of 22-October-2009 version?

    Kind Regards,

    Asaf

    Monday, October 19, 2009 6:44 PM
  • Hi Asaf,

     

    Yes, Windows 7 RTM is exactly the version which is shipped on 22 October and this issue is not fixed in this version of Windows 7.  Since this problem is really complicated and related to several other issues as I have said, it won’t be fixed soon. 

     

    Hope you can understand.

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, October 20, 2009 3:34 AM
  • Hi Assaf,
     I have a small windows form app and yesterday I hit the same issue you described. For what it's worth, to work around the problem with the DatePicker date format on Win 7 with Hebrew regional setting, I moved the CustomFormat string to my app.config file and entered the following:

          <setting name="datePickerCustomFormat" serializeAs="String">
             <value>mm:HH yy/MM/dd</value>
         </setting>

    "Flipping the field order" caused the date to display correctly.

    Not a great solution, but it is flexible and can be changed simply if and when the Product Group resolves the issue.

    Barry
    Monday, November 2, 2009 8:21 AM
  • Hi,

    Thanks for the propsed solution.

    Is there  ant progress with this issue?
    This is a very annoying bug.

    Even if I use the solution I will have to contact my customers and change the app.config again after Microsoft will release a fix.


    Does anybody know when a fix will be available?

    Yaron
    Thursday, November 26, 2009 11:31 AM
  • Hi,
    I encountered the same problem.
    did microsoft came out with a solution or update for the problem?
    Monday, December 14, 2009 8:56 AM
  • Hello Tisrael,

    I have sent an email on 01-December-2009 with a description of this problem also with a link to this thread to the manager of Windows 7 product at Microsoft Israel but I haven’t received any reply from him yet.

    Kind Regards,

    Asaf

    Monday, December 14, 2009 10:25 AM
  • Hello Tisrael,

    I have sent an email on 01-December-2009 with a description of this problem also with a link to this thread to the manager of Windows 7 product at Microsoft Israel but I haven’t received any reply from him yet.

    Kind Regards,

    Asaf


    You shall send to Microsoft in United States (U.S.), I think that they can do much more
    to solve a problem like this one, however, I have not experienced such problem in Windows 7 yet.
    Coder24.com
    Monday, December 14, 2009 10:28 AM
  • Hello Microsoft,

    Are we going to have an update that will fix this issue in the near future?

    Asaf
    Wednesday, January 27, 2010 6:58 AM
  • Take it easy Asaf, Microsoft are busy,
    there are new patches released every day,
    keep Windows up-to-date.
    Coder24.com
    Wednesday, January 27, 2010 9:53 AM
  • Mr. Coder24.com,

     

    I believe you are not facing customers every day complaining and making mistakes with dates because of such annoying bug that cost them money! And I am sure you are not the one who is talking with them and having there shouts about that your product is not good and they do not care that this bug is out of the Windows 7 box. Not mentioned the time we have to waste because of it on support.

     

    This issue is business critical, so again I would like to hear from a Microsoft representative when they are going to solve this *BIG* issue!

     

    Kind Regards,

     

    Asaf  

    • Edited by asafgo Saturday, March 13, 2010 7:05 AM
    Monday, February 1, 2010 4:09 PM
  • Or you can develope your own time technology,
    by using the Formats for current dates in different
    countries.

    ToString(""); //Put format inside there.

    Or you do as I did when it comes to Business apps,
    apply your own technology.

    Best regards,
    Fisnik
    Coder24.com
    Monday, February 1, 2010 4:13 PM
  • I would suggest trying to find a third party datetimepicker control, I'm sure there are many out there.
    Monday, February 1, 2010 5:26 PM
  • Hi Asaf,

     

    I can understand the issue is annoying.  I have done my best to retrieve some updated information from the product team.  Unfornately, in Windows 7 RTM, this issue won't be fixed.  Because this problem is very complicated and related to several other issues. 

     


    Hi Asaf,

    By the way, if the support engineer at http://support.microsoft.com/ needs some additional information, you can give them my email address: v-micsun @ microsoft.com.  I am glad to give a hand.



    Have you tried to formally bring the issue to their attention?  You really should.

    If anyone can help speed up the process of identifying the causes, Lingzhi Sun is your best bet.
    Follow Lingzhi Sun's advice and report the issue if you have not done so.
    Take a more active role in assisting with the issue. 
    The development team may not even be aware of it at this late date.

    Good Luck.

    Rudy  =8^D

    Mark the best replies as answers. "Fooling computers since 1971."
    Monday, February 1, 2010 7:21 PM
  • Hello All,

    After posting this bug to Microsoft support all credits belongs to Mr. Ron Stock who did everything in order to bring this bug to fix with KB 2030901

    http://support.microsoft.com/kb/2030901

     

    Kind Regards,

    Asaf

    • Marked as answer by nobugz Tuesday, November 2, 2010 2:52 AM
    Thursday, June 24, 2010 11:07 AM
  • Thanks,

     

    Just saw this thread today, but suffering from the problem since Windows 7 was released and tried my luck in some other Microsoft  forums.

    i.e.  http://windows7forums.com/windows-7-programming-scripting/16230-net-dtp-datetimepicker-righttoleftlayout.html

    I guess I did not describe the problem clear as Asaf did.

    Efy T.

     

    P.S. I have also a wrapper on the DateTimePicker control to allow null value, I am trying to run it sometimes on a 64 bit windows server machine but the control fails to show any value on that machine, and trying to debug it on that machine makes the VS stop responding, if someone here thinks he may help with that, (it will be really appreciated) I will send the code here..

     

     

    Sunday, October 31, 2010 5:13 PM
  • Hi everyone,

    Maybe this is not the right forum but I have already asked the question here, so here is the solution I found here: http://efreedom.com/Question/1-2089268/ListView-CustomDraw-Working-64-Bit-Platforms

    Look at the answer in the link I added the MNHDR structure should be changed to work fine, tested on win7 32 bit, and Win server 64 bit.

    I hope this will save someone else’s time.

    All the best,

    Efy

     

    • Marked as answer by Rudedog2 Sunday, October 31, 2010 8:57 PM
    • Unmarked as answer by nobugz Tuesday, November 2, 2010 2:52 AM
    Sunday, October 31, 2010 6:28 PM
  • Hi everyone,

    Maybe this is not the right forum but I have already asked the question here, so here is the solution I found here: http://efreedom.com/Question/1-2089268/ListView-CustomDraw-Working-64-Bit-Platforms

    Look at the answer in the link I added the MNHDR structure should be changed to work fine, tested on win7 32 bit, and Win server 64 bit.

    I hope this will save someone else’s time.

    All the best,

    Efy

     


    Not able to fully test the solution, but I see that the soggestion can from Hans Passant.  I will mark your reply as answer. 
    Mark the best replies as answers. "Fooling computers since 1971."

    http://rudedog2.spaces.live.com/default.aspx

    Sunday, October 31, 2010 8:59 PM