<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Services</title><link>https://www.infopathdev.com:443/forums/48.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Date and Time</title><link>https://www.infopathdev.com:443/forums/thread/17591.aspx</link><pubDate>Wed, 01 Mar 2006 20:38:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17591</guid><dc:creator>skully</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17591.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17591</wfw:commentRss><description>Sakieboy, could you post the VB.NET code you refered to above? It looks like a fix I'd like to try.&lt;br /&gt;&lt;br /&gt;Thanks!</description></item><item><title>Re: Date and Time</title><link>https://www.infopathdev.com:443/forums/thread/17590.aspx</link><pubDate>Tue, 02 Nov 2004 23:07:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17590</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17590.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17590</wfw:commentRss><description>Thanks for sharing your solution with us!&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]</description></item><item><title>Date and Time</title><link>https://www.infopathdev.com:443/forums/thread/17452.aspx</link><pubDate>Mon, 01 Nov 2004 19:55:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17452</guid><dc:creator>sakieboy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17452.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17452</wfw:commentRss><description>My SQL data type is smalldatetime.&lt;br /&gt;My Web Service dataset type is datetime.&lt;br /&gt;&lt;br /&gt;My data looks like this:&lt;br /&gt;&lt;b&gt;"11/9/2004"&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;My SQL statement looks like this:&lt;br /&gt;&lt;b&gt;              DATEADD(hh,13,tEOR.AnticipatedStartDateAndTime) AS AnticipatedStartDateAndTime, &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;My XML Web Service data looks like this:&lt;br /&gt;&amp;lt;AnticipatedStartDateAndTime&amp;gt;2004-11-09T13:00:00.0000000-05:00&amp;lt;/AnticipatedStartDateAndTime&amp;gt;&lt;br /&gt;&lt;br /&gt;My data ends up displaying in InfoPath as 8:00 (13 minus 5).&lt;br /&gt;My actual data should reflect only the "13:00:00", I'm not sure where the "05:00" is coming from.  Possibly Grenwich time or something.&lt;br /&gt;&lt;br /&gt;Does this have something to do with my regional time settings or something?  If so, where do I need to go and change this at.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SOLUTION:&lt;/b&gt;  Since this is a known bug...via&lt;a target="_blank" href=http://blogs.msdn.com/dareobasanjo/archive/2004/04/14/113179.aspx&gt;http://blogs.msdn.com/dareobasanjo/archive/2004/04/14/113179.aspx&lt;/a&gt;&lt;br /&gt;we'll need to do a work-around.  First, within the Web Service, keep your type as DateTime and do NOT change it to string, since (hopefully) a fix will come sometime soon (who knows when).&lt;br /&gt;Second, if you are developing the InfoPath form as a project in Visual Studio .NET you're in luck, if not, you'll need to convert the following code to script.&lt;br /&gt;&lt;br /&gt;In my case, within one of the OnAfterChange events I have the following code:  Note: this is C#, I've also converted it to VB.Net&lt;br /&gt;so let me know if you need that code too.&lt;br /&gt;&lt;br /&gt;IXMLDOMNode myNode1 = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/s0:SelectEmploymentResponse/s0:SelectEmploymentResult/ns1:DataSet1/ns1:dbo_udp_SelectEmployment/ns1:MyDateAndTime");&lt;br /&gt;			GetDateAndTimeFromNode(myNode1);&lt;br /&gt;&lt;br /&gt;This will need to be done for every datepicker on the form.&lt;br /&gt;&lt;br /&gt;Here's the routine for GetDateAndTimeFromNode():&lt;br /&gt;&lt;br /&gt;		public void SetDateTime(IXMLDOMNode myNode) {&lt;br /&gt;int NOONORMIDNIGHT=12;			&lt;br /&gt;string myDate = myNode.text.Substring(0,10);&lt;br /&gt;			string myTime = myNode.text.Substring(11, 8);&lt;br /&gt;&lt;br /&gt;			if(myNode != null)&lt;br /&gt;			{&lt;br /&gt;				string ifbefore10am="";&lt;br /&gt;				int remainderoftimestringafterhour=0;&lt;br /&gt;				//not sure of how to get military time, so I'll add 12 hours, unless the time is 12, then I'll subtract 12&lt;br /&gt;				int ihr;&lt;br /&gt;				if (String.Compare(myTime.Substring(2,1), ":") == 0) &lt;br /&gt;				{&lt;br /&gt;					remainderoftimestringafterhour = 2;&lt;br /&gt;					ihr = Convert.ToInt32(myTime.Substring(0,remainderoftimestringafterhour));&lt;br /&gt;				} else 	{&lt;br /&gt;					remainderoftimestringafterhour = 1;&lt;br /&gt;					ihr = Convert.ToInt32(myTime.Substring(0,remainderoftimestringafterhour));&lt;br /&gt;				}&lt;br /&gt;				&lt;br /&gt;				if (String.Compare(myTime.Substring(myTime.Length - 2, 2), "PM") == 0)&lt;br /&gt;				{&lt;br /&gt;					if (String.Compare(myTime.Substring(0,2), Convert.ToString(NOONORMIDNIGHT)) != 0) {ihr+=NOONORMIDNIGHT;}&lt;br /&gt;				}&lt;br /&gt;				else if (String.Compare(myTime.Substring(0,2), Convert.ToString(NOONORMIDNIGHT)) == 0)&lt;br /&gt;				{&lt;br /&gt;					//do something - MIDNIGHT&lt;br /&gt;					ihr = 0;&lt;br /&gt;					ifbefore10am = "0";&lt;br /&gt;				} else {&lt;br /&gt;					//not MIDNIGHT, but before 10:00:00 AM&lt;br /&gt;					if (ihr &amp;lt; 10) {ifbefore10am = "0";}&lt;br /&gt;				}&lt;br /&gt;				myNode.text=myDate + "T" + ifbefore10am + Convert.ToString(ihr) + myTime.Substring(remainderoftimestringafterhour,6);&lt;br /&gt;			}&lt;br /&gt;		}&lt;br /&gt;&lt;br /&gt;This conversion is done because the DatePicker expects the Time to be in a military time format.&lt;br /&gt;&lt;br /&gt;There may or may not be a few declaration issues, since I've kinda piece together the code, but it should be fairly easy to remedy.&lt;br /&gt;&lt;br /&gt;Hope this helps...&lt;br /&gt;&lt;br /&gt;</description></item></channel></rss>