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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:30:38+00:00 2026-05-23T09:30:38+00:00

I have a predictions-based app that’s up on Windows Azure ( http://ipredikt.com ). From

  • 0

I have a predictions-based app that’s up on Windows Azure ( http://ipredikt.com ). From what I can tell Azure’s clock is synchronized to the GMT time zone. Here is a problem that I am encountering:

Let’s say I have a DB field called CreateDate of type DateTime and I set its value to June 10, 2011, 12:30am. when a new prediction is created. If I peek inside the db table the date is correctly set. I don’t touch or change this value in any way. However, when I read the value with our API, serialize it and send it to the client I get a date with the value of June 09, 2011, 5:30 pm. (The API dll also lives on the cloud and probably is collocated with the DB.)

My client browser is running in the PST (pacific time zone) and it seems that the 7 hour difference is due to the difference between PST and GMT. The API code used to serialize the value is similar to this:

System.Web.Script.Serialization.JavaScriptSerializer serializer = new JavaScriptSerializer();

return serializer.Serialize(dataObject);

Is this a bug in JavaScriptSerializer object or is there a trick to fix this delta? Basically, I don’t want the .NET framework to interfere with this value in any way, I just want the DB field to just get returned as is.

  • 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-23T09:30:38+00:00Added an answer on May 23, 2026 at 9:30 am

    When you pass DateTime object to Azure its Kind equals to Local.
    (June 10, 2011, 12:30am -7)

    However, when you save it to the database the region information is lost. Subsequently, when reading this field from the database it creates DateTime with a Utc region
    (June 10, 2011, 12:30am 0)

    Eventually, your client reads the datetime incorrectly.

    There are several options to resolve this issue.

    1) Convert DateTime to DateTimeOffset in Method parameters as well as in database. This will guarantee that your Local region (ie PST) will be saved in db

    2) Use DateTime.SpecifyKind(dateTime, DateTimeKind.Unspecified) – this way the kind of DateTime is unspecified and subsequently saved as is in the db.

    var timeNow = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Unspecified);
    serviceClient.SaveTime(timeNow);
    var dateTime = serviceClient.GetTime();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CoreData-based application that retrieves data about past events from an SQLite
I have just created an algorithm for item based collaborative filtering, that can take
I have a piece of C code that is used from a C++ function.
I have a weird problem with R that I can't seem to work out.
I have a data set that I'm trying to use rfe() from the caret
I guess no one will have a definative answer to this but considered predictions
I have a 5-6 tables in my database that I need to populate with
I have a windows service which runs in multiple production instances. The configuration file
I have a website for football betting predictions. I get the available matches using
I have the following array: Driver[] predictions = new Driver[6]; predictions[0] = new Driver(10,

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.