• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

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 ?

0
dkmarsh
Asked:
dkmarsh
  • 2
1 Solution
 
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now