DateTimePicker - non-English characters

I have a small program where in one element the user selects the date from a DateTimePicker control. This date is then used as part of a file name in the format "23May2006".

Recently the program was installed on a PC that had Chinese language Windows XP installed and the month part of the date was changed into what I assume were Chinese characters.

Does anyone know how I can force the output to remain in 'English' characters.

The reason for this is that the file produced is transferred to another machine where the date is parsed from the file name (and it falls over when it encounters the non-English characters!).

Thanks in advance for any advice.



Answer this question

DateTimePicker - non-English characters

  • Nethol

    in addition to what maksim said:

    you can try to change the SHORT datetime format of the system in the regional settings like the following:

    Start ==>Control Panel ==>Regional And Language Options==>Select a preference or Customize



  • Margie from Seattle

    Hi,

    In case you need specifically english, US formated date the code would be:

    DateTimePicker1.Value.ToString(New CultureInfo("en-US", False).DateTimeFormat)

    Other wise play around with DateTimeFormatInfo class to get format that you desire.

    Max



  • skweaz

    Max / Mario

    Thanks for the suggestions.

    I'll do some playing and then send it to China for the testing (I don't have a PC with Chinese Windows on).

    I'll most likely try a couple of solutions for them to test.

    Thanks for your help and fast response


  • DateTimePicker - non-English characters