pcPirate Posted October 15, 2003 Posted October 15, 2003 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 Quote Be you his eunuch, and your mute I'll be: When my tongue blabs, then let mine eyes not see.
*Gurus* Derek Stone Posted October 15, 2003 *Gurus* Posted October 15, 2003 Use the [msdn=System.DateTime]DateTime.ParseExact()[/msdn] method instead. Quote Posting Guidelines
pcPirate Posted October 15, 2003 Author Posted October 15, 2003 Thanks very much pcPirate Quote Be you his eunuch, and your mute I'll be: When my tongue blabs, then let mine eyes not see.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.