Here is a strange option.
We have a C # interface that was launched from the beginning of the year without problems on a Windows XP (32-bit) PC. We just upgraded the PC to Windows 7 (64 bit) with the applications installed by SCCM.
At the last launch, dates in the text area began to appear in the US format (5/2/2014), and not in the UK format (02/05/2014).
Used code:
string Lines = FromFormat.Text + " from " + FromFormat.Charge_From.ToShortDateString() + " to " + FromFormat.Charge_To.ToShortDateString() +".";
Where FromFormat is an object with raw data, Charge_From and Charge_To are DataTime variables.
We checked the regional settings of the PC and created a small test application to display the PC settings from .Net, both of which are installed in the UK format. Code for the test application:
label1.Text = DateTime.Now.ToString(); label2.Text = DateTime.Now.ToString("dd MMM yyyy"); label3.Text = DateTime.Now.ToShortDateString(); label4.Text = Thread.CurrentThread.CurrentCulture.EnglishName;
I know that I can replace ToShortDateString() with ToString("dd/MM/yyyy") to force the correct format, but my question is why this happens?
Does this have something to do with updating Windows 7? or SCCM?
Thanks in advance
source share