<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: InfoPath rules time different from C# time in same form?</title><link>https://www.infopathdev.com:443/forums/thread/75542.aspx</link><pubDate>Tue, 21 Feb 2012 14:21:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75542</guid><dc:creator>Trevor Arter</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75542.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=75542</wfw:commentRss><description>&lt;p&gt;Yes that fixed it thanks&lt;/p&gt;
&lt;p&gt;I thought the U was just formatting&lt;/p&gt;</description></item><item><title>Re: InfoPath rules time different from C# time in same form?</title><link>https://www.infopathdev.com:443/forums/thread/75541.aspx</link><pubDate>Tue, 21 Feb 2012 14:00:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75541</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75541.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=75541</wfw:commentRss><description>Are you one timezone away from England?&amp;nbsp; The &amp;quot;U&amp;quot; format string produces UTF time so that would explain the discrepancy.&amp;nbsp; For local time, you can just use DateTime.Now.ToString().</description></item><item><title>InfoPath rules time different from C# time in same form?</title><link>https://www.infopathdev.com:443/forums/thread/75538.aspx</link><pubDate>Tue, 21 Feb 2012 13:35:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75538</guid><dc:creator>Trevor Arter</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75538.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=75538</wfw:commentRss><description>&lt;p&gt;Hi All&lt;/p&gt;
&lt;p&gt;I have a form containing both rules and code&lt;/p&gt;
&lt;p&gt;When the form is created it sets the creation date according to a rule in form open behaviour:&lt;/p&gt;
&lt;p&gt;&amp;quot;Set a fields value: CreatedWhen = now&amp;quot;. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;This sets the time correctly&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The same form has some C# code:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//record time date and user updated&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; s;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DateTime&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; now = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DateTime&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Now;&lt;/p&gt;s = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Updated: &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + now.ToString(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;U&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,culture) + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot; by: &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + System.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Environment&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.UserName;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;sSetField(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;CommentTotalAll&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, s);&amp;nbsp; //This just&amp;nbsp;writes the string to a text field using an XPath Navigator&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The trouble is that the date set by the code is one hour behind in relation to the computers time, while the time set by rules is correct. Does anyone know why this could be? (I&amp;#39;ve tried changing the culture, that made no difference)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks&lt;/p&gt;
&lt;p&gt;Trevor&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>