ASP.NET website & SQL Server - how to set local date / time and date format

Hi. I am hosting an ASP.NET website and SQL Server database in USA.

I am accessing this from New Zealand and want the system to display New Zealand local date / time and also date format dd/mm/yy instead of mm/dd/yy.

Is there a setting for web.config or something I can set so the site uses local date / time ?

dkmarshAsked:
Who is Participating?
 
GiftsonDJohnCommented:
Hi,

There is no way you can do it from the server side until you maintain a profile of the users and the location in your database. But you can do it from client side.

http://www.codeproject.com/KB/aspnet/Remote_Time_Zone.aspx


0
 
SyferBCommented:
Yes you can.
Add the following to your web config

<configuration>
  <system.web>
    <globalization
       fileEncoding="utf-8"
       requestEncoding="utf-8"
       responseEncoding="utf-8"
       culture="en-NZ"
       uiCulture="en-NZ" />
  </system.web>
</configuration>
0
 
GiftsonDJohnCommented:
Yes. But it will display in NZ time zone for all the zones (including US)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.