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 7925507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:19:16+00:00 2026-06-03T18:19:16+00:00

My web server is in east coast. I sent an email from my web

  • 0

My web server is in east coast.
I sent an email from my web server at 1PM PST time which is 4PM Eastern time.
I am resided in west coast and when I see the page, it shows 4PM which is future time for me.

How can I see 1PM, someone in east coast 4PM and so on?

The date is stored in MongoDB which is UTC. I also convert date before displaying:

@Model.DateSent.ToLocalTime().ToString();

This is how I set the time when mail is sent:

DateTime.UtcNow <-- So I am storing date in UTC already

Thanks

  • 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-06-03T18:19:17+00:00Added an answer on June 3, 2026 at 6:19 pm

    There are two parts to your question. The first is the mechanics of localizing a dateTime in C#. Since I’m not a Windows guy, I’ll leave that to either someone else to answer or you to look up in the docs, but I’m willing to bet that ToLocalTime() has a friend that takes a TimeZone or a Locale.

    The second part, which is more interesting, and something I’ve had to deal with a few times in the past is how to know what timezone to use. There’s no right answer, but there are a few strategies:

    • The simplest, and perhaps the best, if there’s a concept in your system of a user account
      is to simply make the Locale a user preference.
    • If there’s no concept of a user account one’s always logged into there are a few ways
      to go

      • you could make it a choice that is saved in the session, but that’s a bit annoying
        to force them to select every time
      • a better alternative might to be geocode the inbound IP address and set it from
        that. There are geocoding apps, databases and services. Most cost, but I know
        MaxMind has a free edition that does ok. That will mostly work. The catch is
        users coming via some large private network. I live near Philadelphia. My home
        network usually geocodes pretty well, though a few services place me in Delaware,
        where my ISP is located. But at work, where the whole company goes out through
        a single web proxy, I look like I’m in North Dakota.
      • more reliable, but perhaps more involved, is to grab the browser’s timezone
        using getTimezoneOffset() in Javascript and push the answer up to the server.
    • I suppose the other option might be to convert the time locally in the browser,
      where the timezone is freely availiable, but that implies that the data is
      coming down via AJax or similar and then being updated via JavaScript. Fine if
      you’re doing a app that is fundimentally Ajax RIA based, just send the data
      in UTC or as a time_t. But kind of silly and annoying for a classic web app
      that isn’t already processing all the data client side.

    My first choice would be a user preference. If that’s not an option I’d probaly push the timezone from the client. And if that’s too involved, go for IP geolocation.

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

Sidebar

Related Questions

I have a web server which I do not know what the time zone
I've got a web server that sends email (from IIS 5.1) to clients throughout
I have a little web server application which reads X bytes from a file
Web Server Controls and Html Server Controls both derive from System.Web.UI.Control. What is the
I have a web server which is protected behind http-basic-auth. I've read through the
I have a web server application (based on python). Flash applications which are located
If a given web server can only read cookies from those set within its
I have a web server hosted with 1and1 which evidently is hosted in Germany,
I'm writing a web server in C (which I suck with) using Pthreads (which
I have a Java web server which I want to send UA push notifications

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.