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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:29:23+00:00 2026-05-27T23:29:23+00:00

Here is how the export works .NET DataTable is created by a SQL Query

  • 0

Here is how the export works

  1. .NET DataTable is created by a SQL Query
  2. DataSet is serialized and sent via HTTP Request to an Importer
  3. Importer Deserializes and performs a series of insert/updates; one per DataTable row

Details

  • Exporting SQL Server is in the Eastern (US) Timezone
  • Importing SQL Server is in the Central (US) Timezone

The Problem

  • A datetime value is 1-3-2012 00:00:00 Eastern (midnight 1/3/12 Eastern)
  • This value is exported through the previous mentioned mechanism
  • When it is deposited to the destination (central) SQL Server, it has the value 1-2-2012 23:00:00 (11:00 PM the day before)

The datetime value should not change from one server to the next. It needs to stay 1-3-2012 00:00:00.

What have I tried?

  • I have confirmed that the corresponding date values are indeed 1 hour off after re-running the export
  • I have confirmed that an hour is not being subtracted by my code
    • Serialization occurs via the BinaryFormatter.Serialize function, with the DataSet itself going right in
    • Deserialization occurs via the BinaryFormatter.Deserialize function
    • A call to a stored procedure is made with one parameter per column in the DataTable. I have confirmed that there is a direct copy for the date value via the following code: CMD.Parameters("@p" & col.ColumnName).Value = row(col.ColumnName)
  • I’ve analyzed the MSDN for DateTime, but based upon my understanding (storing Date in the first 4 bytes, time in the last 4 bytes) there should never be a switch to a different day, even if each block of 4 bytes represents some relative offset from some base day or time
  • I have confirmed that the moment the DataSet is deserialized in the new timezone, all datetimes have shifted 1 hour

This really feels like a timezone issue, but I can’t figure out where it might be.

  • 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-27T23:29:23+00:00Added an answer on May 27, 2026 at 11:29 pm

    Transferring a datetime from one SQL Server to another SQL Server via an UPDATE query across a Linked Server connection will preserve the date and time. 1/3/12 Midnight comes across as 1/3/12 Midnight, despite the time zone change.

    However, by injecting the dates into a .NET Dataset, you subject the SQL DateTime variables to a data conversion to .NET DateTime.

    The display of a DateTime varies by TimeZone. If you load the same bits in Boston as you do in California via the ToString() function, you will get two different results.

    As a result, by the time this code is called, the damage is done

    • CMD.Parameters("@p" & col.ColumnName).Value = row(col.ColumnName)

    To fix this problem, you must either determine the time zone offset and adjust the value, or serialize to a safer format, thus avoiding the .NET DateTime, as mentioned by @competent_tech.

    References

    • SQL Server DateTime
    • .NET DateTime – Scroll down to “Datetime Values” section
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following (or rather not following!) the tutorial found here: http://www.flashuser.net/flash-tricks/tips-tricks-10-using-drag-drop-in-actionscript-3-0.html I've drawn a
Here is the issue I am having: I have a large query that needs
so I have a function that exports some data async via asp.net and displays
I have this code which export data from GridView to csv. It works with
I need a datepicker widget via ExtJs on my pages that works like this
Here's my situation. I'm developing an ASP.NET (2.0) app for internal use. In it,
I use the AVAssetExportSession to export mp3/m4a files in ipod library. This method works
I am trying to export some data from a SQL Express table to Access
I'm trying to create a generic graphics export tool which works by implementing the
Here's a sample of the XML I'm working with (retrievable from any wiki's Special:Export/SomePage

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.