Change regional Setting in C#

pcPirate

Regular
Joined
Aug 12, 2003
Messages
66
Location
Kuala Lumpur, M'sia
Hi,

In C#,
In my Regional Setting (Control Panel's Setting), the date format set is "mm/dd/yyyy".

string sDate = "15/06/2003";
if I use the Convert.ToDate( sDate ); , a format error would prompt out because the system treated 15 as month and not the day. If I change the regional setting date format to "dd/mm/yyyy", then the error is overcome. However, I don't feel manual changing the Regional Setting is wise.

i) Is there any way I can solve the above problem just by C# coding?

Pls advise and Thanks in advance.

pcPirate
 
Back
Top