Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6751431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:55:35+00:00 2026-05-26T12:55:35+00:00

We have an ASP.NET website and an SQL database hosted in US. Whenever I

  • 0

We have an ASP.NET website and an SQL database hosted in US. Whenever I use the function Now() in VB.NET and getdate() in SQL, I get the US’ current time. The problem is, the client is in the Philippines which is on GMT+8 Time Zone. My question is, is there any way I can set the Time Zone of a specific database and website so that when I use the functions, I’ll get the Philippine’s current time? How do you deal with this? As much as possible, we don’t want to do subtraction or addition to the result date of the functions since in the future, clients will be from other country. It will give us headache updating the codes if we do that.

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:55:36+00:00Added an answer on May 26, 2026 at 12:55 pm

    Given that your clients may be in different time zones, you should store a timezone for the clients, that they (or you) can set as a preference for their account. Store all dates+times as UTC, and then convert to their timezone when displaying results in your interface.

    This question has already been addressed to a great extent in the following question:
    How to work with time zones in ASP.NET?

    Follow-up:
    Unfortunately, the SQL server date is a system-level setting, so it’s not really something that can be manipulated on a per-session basis. It sounds like you will need to make some code changes, but you can isolate them.

    1. Do you have a session-level variable which contains the client time zone offset? If not, create one.

    2. Create a small date/time utility class.

    3. In the utility class, provide 3 methods to:
      (1) get the current date/time (offset to the client’s time zone)
      (2) pass in a database date/time to return the time offset for the client’s TZ.
      (3) pass in a time from the client to subtract out the client’s TZ difference.

    You will have to make code changes, but you can probably use those utility functions to wrap inputs and outputs everywhere, centralizing the logic. Microsoft has a page about mis-steps to avoid when using the DateTime class and manipulating time zones:
    http://msdn.microsoft.com/en-us/library/ms973825.aspx#datetime_topic1a

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP .NET 2.0 website connected to a SQL Server 2005 database.
I have developed a website using Asp.Net MVC which uses a SQL CE database
I have as ASP.Net 2.0 website with SQL Server as database and C# 2005
I have an asp.net website (SQL Server, Windows 2003, IIS 6) and I am
I have a process in a website (Asp.net 3.5 using Linq-to-Sql for data access)
I have an asp.net app hosted at a (for now, unnamed) hosting company. This
I have an ASP.Net website which uses a MySQL database for the back end.
In my current project, we have to create a website (ASP.NET MVC) which is
I currently have an asp.net website hosted on two web servers that sit behind
I have a asp.net-mvc website with a SQL server backend (using nhibernate for OR

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.