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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating date format in local format 1

Status
Not open for further replies.

rotsey

Programmer
Nov 23, 2004
135
0
0
AU
Hi,

I have a date field in an Access database and I want to display it to the user in there local format. Easy you say.

Well documentation says using Format function that using the "d" option should format in locale of user.

Doesn't work for me.

Does anybody no how to do this??

Thanks
rostey
 
I was going to guess that it uses the locale of the server, not the user. Is locale something specified in a request variable that .NET could pick up on and automatically change? Many website I've visited (ones with some kind of login) allow me to specify it in some kind of user preferences and it just always reads from there whenever it displays a date.

________________________________________
Andrew

I work for a gift card company!
 
I found this on google

You use the language setting in request variables and set the culture to the client value

Thread.CurrentThread.CurrentCulture = New CultureInfo(Me.Request.ServerVariables("HTTP_ACCEPT_LANGUAGE"))

Then if do

dt.tostring("d") or something it will format correctly
 
nice

________________________________________
Andrew

I work for a gift card company!
 
Another star...

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
hmmm. Seems there might be a problem with Netscape.

This is what my language varible is

en-us, en;q=0.50

And this causes an error.

Any ideas?????????/

rotsey
 
I'm not sure...try the Browser issues forum (forum608) or the HTML forum (forum215) as they may have more experience.

You could even thank them with a star if they help you...[smile]

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top