locked
How to disable timezone conversion of dates in web services? RRS feed

  • Question

  • I'm uploading a dataset that has some date and date/time values in it from a variety of machines.  I'm seeing that the webservices are automatically changing the times based on the difference in timezone between the client and the server.  How can I disable this behavior?  I know in many cases this would be desired, but in this case, it is not desired.

     

    I'm using .Net 2.0 on both client and server.

    Monday, July 30, 2007 12:22 PM

Answers

  • Unfortunately Dataset serialization does not support what you're trying to do but, happily, the XmlSerializer does.  so if you were to use XmlSerializer directly (not with Dataset) you would get the behavior you want by default in 2.0. 

     

    hope it helps (let me know if it doesn't)

    Alex DeJarnatt

    Connected Framework Team

    Tuesday, July 31, 2007 1:27 AM
    Moderator

All replies

  • Unfortunately Dataset serialization does not support what you're trying to do but, happily, the XmlSerializer does.  so if you were to use XmlSerializer directly (not with Dataset) you would get the behavior you want by default in 2.0. 

     

    hope it helps (let me know if it doesn't)

    Alex DeJarnatt

    Connected Framework Team

    Tuesday, July 31, 2007 1:27 AM
    Moderator
  • what about later versions of .net? & what is the solution for this?

    Saturday, December 29, 2012 11:31 AM
  • The solution, as stated by Alex DeJarnatt five years ago, is to use XML Serialization directly, instead of using a DataSet.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Wednesday, January 2, 2013 6:46 PM
    Moderator