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

  • SEARCH
  • Home
  • 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 1035469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:32:50+00:00 2026-05-16T14:32:50+00:00

I have an asp.net mvc calendar application (using jquery ui datepicker) and i am

  • 0

I have an asp.net mvc calendar application (using jquery ui datepicker) and i am running into a weird situation where when i test on a US webserver i see a certain date and when i test on a London web server i see a different date (the date before)

Here are the details:

I am storing a date in sql server as:

 2010-09-16 00:00:00.000

I am then loading that into C# DateTime object.

I need to pass that down as part of a json object to my clientside javascript so i was suggested this solution:

jsonobject.Date = UnixTicks(a.Date),

where UnixTicks is:

private static double UnixTicks(DateTime dt)
    {
        DateTime d1 = new DateTime(1970, 1, 1);
        DateTime d2 = dt.ToUniversalTime();
        TimeSpan ts = new TimeSpan(d2.Ticks - d1.Ticks);
        return ts.TotalMilliseconds;
    }

I am then converting it to a javascript date by using this code below on the client side:

var d = new Date(jsonobject.Date);

does anyone know why given a US server or a London server i would get back a different date. At first, i thought it was the

 DateTime d2 = dt.ToUniversalTime();

but i changed that to:

 DateTime d2 = dt;

and still saw the same issue. (on London web server date would show up 1 day prior to the US web server)

any suggestions?

  • 1 1 Answer
  • 1 View
  • 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-16T14:32:50+00:00Added an answer on May 16, 2026 at 2:32 pm

    If you’re storing local time in the database instead of UTC, then you could get different dates back when converting back to local time. Make sure your dates are converted to UTC before you commit them to the database. If you want everyone to always see the same date no matter where they are, always return the UTC date- do not convert back to local time.

    • 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 mvc 2.0 application that contains Areas/Modules like calendar, admin, etc...
I have ASP.NET MVC application that has list with jQuery Selectable list. My problem
Folks, I have ASP.NET MVC 3 Application and I have the following JQuery script
I have asp.net mvc application. i want to configure the object in jquery and
i have the following situation. I am developing a MVC 3 asp.net application. I
I am using asp.net mvc 3 and jquery 1.5.2 with jquery full calendar 1.5.1
I'm using Asp.NET MVC and have a huge dependency on JQuery throughout my entire
I have an ASP.NET MVC application that is calendar-like. As per the NerdDinner example,
I am building a calendar web page using jQuery and asp.net-mvc similar to this
I have a jquery calendar on my asp.net MVC view and I want to

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.