<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx</link><description>One thing we haven&amp;#39;t publicized much on this blog yet is a new date time structure we&amp;#39;ve added in .NET 3.5 called DateTimeOffset (currently available as part of .NET Framework 3.5 Beta 1 ). Kathy mentioned it on her blog a while back and Daniel</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3298289</link><pubDate>Fri, 15 Jun 2007 00:57:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3298289</guid><dc:creator>MichaelGiagnocavo</dc:creator><description>&lt;p&gt;What's wrong with just using DateTime to refer to UTC? In all our code we have DateTime, and it's always UTC (as is the timezone on all our servers). What am I missing? &lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3300974</link><pubDate>Fri, 15 Jun 2007 02:58:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3300974</guid><dc:creator>chronos</dc:creator><description>&lt;p&gt;Microsoft,&lt;/p&gt;
&lt;p&gt;This DateTimeOffset type will not be sufficient. I need a DateTime (ie, something that extends DateTime), not something that can convert into a DateTime.&lt;/p&gt;
&lt;p&gt;Please unseal the type and I will do the work myself.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3301642</link><pubDate>Fri, 15 Jun 2007 03:43:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3301642</guid><dc:creator>Paul Bartrum</dc:creator><description>&lt;p&gt;chronos, DateTime is a structure and thus cannot be inherited.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3302075</link><pubDate>Fri, 15 Jun 2007 04:03:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3302075</guid><dc:creator>chronos</dc:creator><description>&lt;p&gt;Then we need an IDateTime interface and _all_ signatures taking a DateTime will need to be depreciated and replaced.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3304365</link><pubDate>Fri, 15 Jun 2007 06:10:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3304365</guid><dc:creator>Axel</dc:creator><description>&lt;p&gt;I always use DateTime.UtcNow whenever I'm referring to an exact point in time.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3305584</link><pubDate>Fri, 15 Jun 2007 07:08:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3305584</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;Axel,&lt;/p&gt;
&lt;p&gt;As do I. However, I have debugged code where specifying UTC was occasionally forgotten. It was a timely and expensive fix.&lt;/p&gt;
&lt;p&gt;I want it to always be in UTC. Nor do I want to worry that my team will get it right. Why should I always need to make the same settings every time? A UTC-only type would be much more desired.&lt;/p&gt;
&lt;p&gt;DateTimeOffset only complicates the situation further and is not an ideal solution. I agree that an IDateTime interface is needed.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3333755</link><pubDate>Sat, 16 Jun 2007 12:04:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3333755</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Paul,&lt;/p&gt;
&lt;p&gt;&amp;gt; DateTime is a structure and thus&lt;/p&gt;
&lt;p&gt;&amp;gt; cannot be inherited.&lt;/p&gt;
&lt;p&gt;In C# that is true, but certainly not in all other languages. Try to compile the following IL into a DLL.&lt;/p&gt;
&lt;p&gt;.assembly Testing {}&lt;/p&gt;
&lt;p&gt;.namespace Foo&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;.class public sequential unicode sealed beforefieldinit MyStruct&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;extends [mscorlib]System.ValueType&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;.class public sequential unicode sealed beforefieldinit MyStruct2&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;extends [mscorlib]System.ValueType&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;implements Foo.MyStruct&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;You may then use it from C#. (And I encourage you to examine the DLL in Reflector.)&lt;/p&gt;
&lt;p&gt;There really is a strong need for a UTC-only DateTime type. Unsealing the type would be sufficient as I am comfortable writing IL. However, an interface is ultimately the better option. All of these new types being added in Orcas is only adding further complication without truely solving the real problem.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3345231</link><pubDate>Sat, 16 Jun 2007 23:08:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3345231</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Not very good IL. This is better:&lt;/p&gt;
&lt;p&gt;.assembly Testing {}&lt;/p&gt;
&lt;p&gt;.namespace Foo&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;.class public sequential unicode beforefieldinit MyStruct&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;extends [mscorlib]System.ValueType&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;.method public hidebysig virtual instance void BaseMethod() cil managed&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ret &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;.class public sequential unicode sealed beforefieldinit MyStruct2&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;extends Foo.MyStruct&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;However, when used in C#, the compiler throws CS0648 (type not supported by the language). It's legal IL, so C# should just consume it.&lt;/p&gt;
&lt;p&gt;In any case, an IDateTime interface is really needed and is the best long-term solution.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3376005</link><pubDate>Mon, 18 Jun 2007 09:17:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3376005</guid><dc:creator>Matthew</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; In any case, an IDateTime interface is really needed and is the best long-term solution.&lt;/p&gt;
&lt;p&gt;I disagree. Better to make a clear distinction between the two types as has been suggested in the post.&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3377920</link><pubDate>Mon, 18 Jun 2007 11:04:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3377920</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Matthew,&lt;/p&gt;
&lt;p&gt;A default DateTime is broken 100% of the time. Every single time it will need to be manually set to be UTC. Any exceptions, probably accidental, and often even due to ignorance or poor design, is a bug to be found and fixed. I have fixed dozens of these bugs over the last six years at several different companies. I have created wrapper types to help solve the problem. However, the best that can be done is wrap DateTime because it can not be extended and there are no interfaces to implement. I have also created my own non-wrapper types that provide the necessary functionality. However, it does not fit into the framework because of incompatible signatures.&lt;/p&gt;
&lt;p&gt;While I have had many unpleasent encounters with this type in particular, the source of the problem is very prevalent throughout the BCL: 1) sealed types and 2) no interfaces. You can do better than this.&lt;/p&gt;
&lt;p&gt;I am perfectly fine if Microsoft does not want to provide the functionality. But let me. To integrate that into the BCL, though, I will need to be able to either extend the type or implement an interface (appropriate signatures will need to take interface, the implementation).&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3418424</link><pubDate>Wed, 20 Jun 2007 10:12:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3418424</guid><dc:creator>Andy Mackie</dc:creator><description>&lt;p&gt;Will DataSets support DateTimeOffset ?&lt;/p&gt;
&lt;p&gt;We currently have the DateTimeMode property to control serialization of dateTimes from datasets. Although it has limitations, like you can't set it after you've loaded any rows, so it's a pain for untyped datasets - need to call FillSchema then Fill. And there were bugs with typed datasets - some claim these still aren't fixed in SP1 - see &lt;a rel="nofollow" target="_new" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=208033&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=208033&amp;amp;SiteID=1&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;So, will Datasets allow columns of type DateTimeOffset ? How would that work for untyped datasets where columns are created on the fly based on the SQL statement - do we need a &amp;quot;create dateTimes as DateTimeOffset's&amp;quot; property ? And could we specify a default timezone like UTC, or allow that to be picked up from a database column ? Whilst Oracle has a timestamp with timezone datatype which could map straight to DateTimeOffset, SQL Server doesn't, so how could we set default timezones in that case ?&lt;/p&gt;
&lt;p&gt; I don't want to get into discussion about whether datasets are evil or not (personally I use objects) but lots of developers do use datasets, so it needs considering.&lt;/p&gt;
</description></item><item><title>DateTime e DateTimeOffset</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3420382</link><pubDate>Wed, 20 Jun 2007 12:12:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3420382</guid><dc:creator>Marco Russo</dc:creator><description>&lt;p&gt;Magari non &amp;#232; uno dei massimi problemi per chi lavora in Europa e generalmente ha a che fare con un solo&lt;/p&gt;
</description></item><item><title>re: DateTimeOffset: A New DateTime Structure in .NET 3.5 [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#3425538</link><pubDate>Wed, 20 Jun 2007 17:45:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3425538</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; Justin Van Patten&lt;/p&gt;
&lt;p&gt;Nope, that IL is not valid nor its metadata.&lt;/p&gt;
&lt;p&gt;ILAsm compiles your Foo valuetype as sealed (even you do not mark it as sealed). If you compile it with &amp;quot;The Monster Flag&amp;quot; (/errors), you can create an unsealed value type. BUT such metadata are invalid. I hope Loader will refuse the assembly...&lt;/p&gt;
</description></item><item><title>DateTimeOffset Guidance</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#4475859</link><pubDate>Mon, 20 Aug 2007 11:27:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4475859</guid><dc:creator>Lazy Coder</dc:creator><description>&lt;p&gt;&amp;quot; Anthony Moore has some guidance on when to use DateTimeOffset vs. DateTime: Use DateTimeOffset whenever...&lt;/p&gt;
</description></item><item><title>What’s new in the .Net Framework 3.5 (Orcas)</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#4897803</link><pubDate>Thu, 13 Sep 2007 21:32:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4897803</guid><dc:creator>Jack Gudenkauf (JackG) WebLog</dc:creator><description>&lt;p&gt;Visual Studio (VS) 2008 and .Net 3.5, code named “Orcas”, will be released in the near future. This release&lt;/p&gt;
</description></item><item><title>Nachlese: TechTalk - Visual Studio 2008 &amp; .NET 3.5</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#5611696</link><pubDate>Tue, 23 Oct 2007 02:30:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5611696</guid><dc:creator>Dariusz quatscht</dc:creator><description>&lt;p&gt;Mein TechTalk ist nun zu Ende. Meine letzte Station heute in Berlin war Lustig und Am&amp;#252;sant, ich hoffe&lt;/p&gt;
</description></item><item><title>.NET Framework 3.5 Now Available! [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#6415319</link><pubDate>Tue, 20 Nov 2007 03:39:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6415319</guid><dc:creator>BCL Team Blog</dc:creator><description>&lt;p&gt;.NET Framework 3.5 and Visual Studio 2008 have officially shipped! Soma has the announcement on his blog&lt;/p&gt;
</description></item><item><title>.NET Framework 3.5 Now Available! [Justin Van Patten]</title><link>http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx#6415970</link><pubDate>Tue, 20 Nov 2007 04:12:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6415970</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;.NET Framework 3.5 and Visual Studio 2008 have officially shipped! Soma has the announcement on his blog&lt;/p&gt;
</description></item></channel></rss>