Problem with WCF and DateTime UTC conversion to local

Posts   
 
    
Keiser
User
Posts: 17
Joined: 21-Apr-2010
# Posted on: 21-Aug-2012 16:55:57   

Hi guys,

having problem with WCF and desktop client with view field of DateTime type. To find out the problem I have: 1) started WCF on local machine connected to production DB 2) started WCF on production machine connected to the same DB 3) desktop client is connecting to point 1) and 2) calling the same WCF method which code is:

        public static VwUserDetailProductListTypedView RepGetUserDetailProductListTypedView (IRelationPredicateBucket filter, int pageNumber, int pageSize, ISortExpression sort)
        {
            VwUserDetailProductListTypedView view = new VwUserDetailProductListTypedView ();
            using (DataAccessAdapter adapter = new DataAccessAdapter())
                adapter.FetchTypedView(view.GetFieldsInfo(), view, filter, Int32.MaxValue, sort, true, null, pageNumber, pageSize);
            return view;
        }

Point 1) is UTC+3 zone and point 2) UTC+2. Filter passed to WCF method is the same, and method returns the same data set. The only problem is that fields of type DateTime present 2 different values. In case of connection 1) datetime field value is the same as in DB (SQL server 200sunglasses In case of connection 2) datetime field value is presented in local time, so moved for 1hour (UTC+3) I checked in CellFormating event what is the kind of that field value and is Unspecified.

What I really need is to present DB value in the grid in any case of TimeZone client connects. This can be resolved on various ways but I whould like to hear from you if there are some properties or LLBLGEN native ways of getting this. I might have overlooked something and could be my own mistake, but tried to revise the code and didn't find anything that would suspect on fault in the code.

Can you please help me with this with suggestions.

P.S. version of LLBLGEN used is Pro v2.6

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 21-Aug-2012 19:20:13   

It depends on how did you save/Insert the dateTime value into the database. In UTC format or in a specific timezone format?

Please check these threads for more details: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=16480

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=20517

Keiser
User
Posts: 17
Joined: 21-Apr-2010
# Posted on: 29-Aug-2012 11:02:50   

Tnx for info... actually went in other direction and resolution of this problem

K.