Re: Typed datasets and DateTime using .NET remoting over differing timezones

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On the surface, it appears to me that the clients should convert all date/times to UTC before sending to the server and that they
should convert all received date/times from UTC to local before displaying. The server would only store/retrieve UTC times.

I don't have a clue why the date time fields in the datasets are getting converted for you, but I think you can live with that as
long as it works consistently. Let the automatic conversion happen where you have datasets and do the manual conversion the rest
of the time.

On 2 Aug 2005 00:28:41 -0700, "PromisedOyster" <PromisedOyster@xxxxxxxxxxx> wrote:

>We have a client/server WinForms/C# application that uses .NET Remoting
>for the middleware. There is a SQL Server database at the back-end. (I
>believe that the same issue exists with WebServices).
>
>The server machine is in one time zone. Some users are in another time
>zone. They connect to the server using .NET Remoting and data is stored
>in a SQL Server database.
>
>If we pass Typed DataSets across the wire then DateTime columns within
>the Typed DataSet work well, presumably because of the Locale property
>on the DataSet. ie the date in the database is the local date/time and
>the date on the records that are returned to/from the client are in
>local time.
>
>However, there are couple of other instances where this model does not
>work:
>
>(1) Passing simple C# DateTime structs across the server boundary do
>not convert to the correct time zone. There is no conversion to the
>local time zone, so the data held may be a few hours out.
>
>(2) When we use DateTime columns to store Date only values. eg
>'12/2/2000 00:00:00' gets presented as '12/1/2000 21:00'
>
>What are the options to get around this problem?
>
>(1) can be solved by us passing datasets across the wire, but means
>additional load which we could possibly wear.
>
>I beleive that UTC is a way around (2). However, I am uncertain as to
>why '12/2/2000 00:00:00' in the dataset in the client time zone, then
>gets stored exactly the same in the database in the different server
>time zone (ie NO conversion) which is good BUT when retrieving, a
>conversion takes place causing no end of confusion.

-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com
.



Relevant Pages

  • Re: [opensuse] best file distribution technology for my case?
    ... I googled a lot and found I am outdated: FTP protocol can do encoding conversion. ... So now if Windows user use standard complaint FTP client, they can get the filenames in correct encoding. ... as long as the server is not compromised, the file integrity is not my concern, because other campus services also have this problem for years and they even offering .exe file for downloading, here I only got audio files, I am sure there will not be so much compliance. ...
    (SuSE)
  • RE: MS Access database to gradually become a server based database - w
    ... SQL Server may provide the smoothest ... I have a large MS Access 2003 database. ... For the gradual conversion I got an idea to make a middle step. ...
    (microsoft.public.access.gettingstarted)
  • Plain text mail is converted to html
    ... The network was recently converted from NT Server to Exchange ... but converted to html in my Sent folder. ... that the html conversion includes FONT SIZE=2 tags which renders things ...
    (microsoft.public.exchange.clients)
  • Mail format problems Exchange 2003
    ... The network was recently converted from NT Server to Exchange ... but converted to html in my Sent folder. ... that the html conversion includes FONT SIZE=2 tags which render things ...
    (microsoft.public.exchange.admin)
  • Re: Performance Problems
    ... the NT/97 configuration 12 megs is being passed between ... Back end server remained constant, ... to #1 above and/or some kind of data type conversion? ...
    (microsoft.public.access.conversion)