c# - Datetime Format in two server -
i have 2 different servers each running webservice. codes of webservices same, time format ,and time zones same on both of servers.
the webservice receives information datetime
sharepoint server , saves them text.
the problem running saves datetime
in 2 different formats.
server 1 format: 15-2-2017 server 2 format: 2-15-2017
what best way both datetime
formats match?
enter code here private void fetchposts() { list<posts> fetchedposts; string queryfilter = string.empty; list list = spcontext.web.lists.getbytitle("posts"); datetime newts = timenow; { camlquery camlquery = new camlquery(); if (!string.isnullorempty(pageinfo)) { listitemcollectionposition pos = new listitemcollectionposition(); pos.paginginfo = system.web.httputility.urldecode(pageinfo); camlquery.listitemcollectionposition = pos; } // if(lastsynctimestamp!=datetime.minvalue) datetime d = datetime.now; datetime d = datetime.now; if(lastsynctimestamp!= d.addmonths(-18)) { queryfilter = string.concat( "<where>", "<gt>", "<fieldref name='modified'/>", "<value type='datetime' includetimevalue='true'>" + lastsynctimestamp.tostring("s") + "</value>", "</gt>", "</where>" ); } camlquery.viewxml = string.concat( "<view>", "<query>", queryfilter, "<orderby>", "<fieldref name='modified' ascending='false'/>", "</orderby>", "</query>", "<rowlimit>" + resultspagesize + "</rowlimit>", "</view>"); listitemcollection listitems = list.getitems(camlquery); spcontext.load(listitems); spcontext.executequery(); fetchedposts = posts.processposts(listitems.tolist<listitem>(), spcontext); if (listitems.listitemcollectionposition != null) { pageinfo = system.web.httputility.urlencode(listitems.listitemcollectionposition.paginginfo); } else { pageinfo = string.empty; } addtocache(fetchedposts); } while(!string.isnullorempty(pageinfo)); lastsynctimestamp = newts; savepostcache(); }
Comments
Post a Comment