Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Regional Settings - Change Calender Settings

Status
Not open for further replies.

arunglobal

Programmer
Sep 8, 2003
40
IN
Hi Guys,

In My application iam using English calender based date settings. But When the user changed to calender settings to japanese Calender then My SQL statements which used to retrieve data based on DATE is Not Working.Since the date stored in database is in english format.

So i need to find the current calender settings of OS then hav to convert the Date which i got from DATETIMEPICKER to English to frame query.

Can any one help me to get the settings of OS and then conversion thru coding...

Thanks in advance
 
Take a look at thread796-847230

The important concept is to keep in your mind is that the formatting of a date is totally separate from the value of a date.

So, when reading from the datetime picker, you put what the user chose into a DateTime variable. When you go to insert it into the database, ADO.NET parameter objects automatically know how to translate it into a format which can be stored in a SQLServer datetime or smalldatetime column (you *are* using SqlParameter objects, aren't you?)

If you're storing dates in a SQLServer char or varchar column, then you need to stop that -- it's not anywhere close to being best-practice, and will cause you numerous problems later.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top