473,382 Members | 1,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

DateTime populaing based on regional settings In ASP.NET Application

Hi All

DateTime populaing based on regional settings In ASP.NET Application

Iam using this Code:
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(HttpContext.Curr ent.Request.UserLanguages[0]);

Thread.CurrentThread.CurrentUICulture = new
CultureInfo(HttpContext.Current.Request.UserLangua ges[0]);

Some Cultures disply the Format
When i am using Windows XP Mechine It's Giving Error Message Like this.
Culture name "zu" is not supported. Parameter name: name

These are the New Cultures for which the following error Message is thrown.
Culture name "zu" is not supported. Parameter name: name
Zulu - zu

Maltese
Xhosa xh
Welsh - cy-gb
Tswana -tn
Serbian sr-ba
serbian(Latin)- sr
sami,southern(sweaden)
sami,southern(Norway)
sami,Skolt - se-fi
sami,Notherm
Quechua(Peru)-qu-pe
Quechua(Peru)-qu-pe
Northenrn sotho -ns-za
Maori
Maltese - mt
Kyrgyz(cyrillic)
Croatian - hr-ba
Bosnian(Latin)

Thank You
Venu

Nov 16 '05 #1
1 1767
Karunakararao,

I don't think that using the languages to get the current culture is a
good idea. There might be some overlap, but in the end, I don't think it
will work, especially for getting the timezone that the user is in. For
example, consider the United States. You could figure out that English is
the language that is being returned ("en-US" I think), but which time zone
would you use? There are three that are used for the mainland. Throw in
Hawaii and Alaska, and there are more.

You are better off having the user indicate what region they are in, and
then base your time calculations based on that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Karunakararao" <ka************@i-vantage.com> wrote in message
news:Ov**************@TK2MSFTNGP15.phx.gbl...
Hi All

DateTime populaing based on regional settings In ASP.NET Application

Iam using this Code:
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(HttpContext.Curr ent.Request.UserLanguages[0]);

Thread.CurrentThread.CurrentUICulture = new
CultureInfo(HttpContext.Current.Request.UserLangua ges[0]);

Some Cultures disply the Format
When i am using Windows XP Mechine It's Giving Error Message Like this.
Culture name "zu" is not supported. Parameter name: name

These are the New Cultures for which the following error Message is
thrown.
Culture name "zu" is not supported. Parameter name: name
Zulu - zu

Maltese
Xhosa xh
Welsh - cy-gb
Tswana -tn
Serbian sr-ba
serbian(Latin)- sr
sami,southern(sweaden)
sami,southern(Norway)
sami,Skolt - se-fi
sami,Notherm
Quechua(Peru)-qu-pe
Quechua(Peru)-qu-pe
Northenrn sotho -ns-za
Maori
Maltese - mt
Kyrgyz(cyrillic)
Croatian - hr-ba
Bosnian(Latin)

Thank You
Venu


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kim Würtz | last post by:
Hi folks I have an C# app. connecting to a MS-ACCESS database with several tables. In a specific situations I have problems with a DateTime type in a table. The problem is when I want to...
5
by: Abdolhosein Vakilzadeh Ebrahimi | last post by:
Is there any way to construct a System.DateTime which doesn't check year, month and day to be in correct range== no validation? Thanks A.V.Ebrahimi
4
by: Shawn | last post by:
Hi. I can't figure out how to solve this problem, so if anyone here can help me I will be forever grateful. I have a web application, which is placed on two different servers. One of the servers...
1
by: Karunakararao | last post by:
Hi All DateTime populaing based on regional settings In ASP.NET Application Iam using this Code: Thread.CurrentThread.CurrentCulture =...
9
by: Simon Osborn | last post by:
I'm trying to format a date and time value to a format that is not the same as in the regional settings. What I mean is: Regional setting is set to US "MM/dd/yyyy". I want to change the...
4
by: Harold Crump | last post by:
Greetings, This is not strictly a ASP.NET question, but I am hoping someone can help. I have an ASP.NET web app that used the DateTime.Parse and Compare methods a lot. As expected, the...
6
by: CK | last post by:
Hi All, Currently the query returns 2006-03-27 00:00:00, can I make it output 03/27/2006, I want to truncate the time, and replace the hyphens with forward slashes. Any ideas? Thanks In...
5
by: iulian.ilea | last post by:
Is correct to have a varchar field and insert dates of type dd/mm/yyyy into it? I choose this method because I have an application that runs on more than one server. So, if I used a datetime field...
5
by: Sreenivas | last post by:
Hi every one, I need to compare to datetime values , done in stored procedure.The input datetime parameter is in dd/mm/yyyy hh:mm:ss AM/PM format ,the datetime values to be compared are also...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.