Culture-specific DateTime string is platform-incompatible

I have a test application that allows the user to select a culture from ComboBox and displays the date of a specific culture in a multi-line TextBox. Code below:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        comboBox1.Items.AddRange(
            CultureInfo.GetCultures(CultureTypes.SpecificCultures));
    }

    private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
    {
        CultureInfo selectedCulture = comboBox1.SelectedItem as CultureInfo;
        DateTime currentDate = DateTime.Now;

        textBox1.Text =
            "My Date : " + currentDate.ToString() + Environment.NewLine +
            "Culture Specific Date: " + currentDate.ToString(selectedCulture);
    }
}

I notice that if "ar-SA" is selected, Arabic (Saudi Arabia), then I see different results when running the application on different machines.

On a Windows 7 computer, the following are displayed in the text box:

My Date: 11/11/2012 4:07:09 PM
Culture Specific Date: 05/19/33 04:07:09 م

On a Windows XP computer, the text box displays:

My Date: 11/11/2012 4:07:09 PM
Culture Specific Date: 20/05/33 04:07:09 م

As you can see, the date of a particular culture is disabled for one day. What could be the cause of this mismatch?

+3
source
1

, , Windows XP Umm al-Qura, Windows 7 , , . , :

, , , .

... , , Windows XP .

( , 19-, .)

+6

All Articles