Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Be you his eunuch, and your mute I'll be:

When my tongue blabs, then let mine eyes not see.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...