<?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>Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx</link><description>The single most requested individual feature for the Base Class Libraries that has not been delivered yet is for support for Time Zones other than Local and UTC. This is a feature we are actively exploring for the next release of the .NET Framework. To</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Time Zones in the .NET Framework [AMoore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#567362</link><pubDate>Mon, 03 Apr 2006 19:15:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:567362</guid><dc:creator>Jeremy Wiebe</dc:creator><description>Something that I would definitely find useful is a data type that supported ToString() formats that could print out the timezone (eg. EST or CST) and an equivalent Parse() or ParseExact() that could parse those 3-letter timezones. &amp;nbsp;&lt;br&gt;&lt;br&gt;IIRC those are only used in North America but the majority of the code I write is for North America so it'd be a very useful addition.</description></item><item><title>re: Time Zones in the .NET Framework [AMoore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#567454</link><pubDate>Mon, 03 Apr 2006 21:19:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:567454</guid><dc:creator>BigJimInDC</dc:creator><description>My vote is for covering these areas, in order of preference (which you listed, so I'll just steal your words and add some comments):&lt;br&gt;&lt;br&gt;- Support for Time Zones with rules that change from year to year&lt;br&gt;---- hopefully for say, given a time zone and a date anywhere from the past 100 years and going forward, you could tell me what the offset is (with daylight savings taken into consideration, obviously)&lt;br&gt;&lt;br&gt;- The ability to serialize Time Zone information, for example in the case of storing the information for a recurring meeting&lt;br&gt;&lt;br&gt;- A data type with a DateTime and a Time Zone offset&lt;br&gt;</description></item><item><title>re: Time Zones in the .NET Framework [AMoore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#567461</link><pubDate>Mon, 03 Apr 2006 21:25:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:567461</guid><dc:creator>Jeff Parker</dc:creator><description>Well here is an example of why I want something or something easier. We are a global fortune 500 company, we have plants all over the world in several time zones. Some that follow the rules and some that don’t (i.e. The places that manually change not by some rules.) We have them in the northern hemisphere and the southern (i.e. winter and summer flip flopped). Now where is the problem I have to deal with all the time. Proprietary EDI formats or some other EDI formats. All of our business is manufacturing and we receive EDI formats from all over the world in multiple formats. We are also on a just in time shipping model. Which means we get orders sometimes an hour or two before they must be shipped, and the parts are not even built yet, but there is a truck on it’s way to pick them up. As a side note all EDI formats come in as flat text files. &lt;br&gt;&lt;br&gt;Ok easy enough except when you get some order from a customer that is in say West European Time Zone that comes in a proprietary customer format that has the date and time the order is due, but absolutely no time zone in it or UTC offset. This is built this way because a WEST company placed an order to a WEST plant. However, here is the monkey in the works; all the servers are in a data center in the USA in EST. So I can not simply do a Convert.ToDateTime() on the time and process as that will take it as the local time and apply a UTC offset of EST. Also I can not simply set a standard add hours to it because Europe and the USA do not convert daylight savings time at the same time. So there would be a couple weeks in there that we would be off by an hour. I could parse the string and add in a UTC Offset but again when I set that offset it becomes a matter of when are they +1 and when are they + 2. Now I have written a ton of my own algorithms and over time I have refined them pretty well to solve these problems but the countries that do not follow any DST rules and kind of do their own thing and change when ever the government says they will change. It gets even worse like this year I think the US is extending DST so that will change my algorithms. At least I put in a way to manually override any country via and XML config file but still there needs to be an easier way. It would be nice if we just had some thing we could call and figure out what the UTC was in a time zone and have this way be scalable and reliable so every year I do not have to go out and figure out what countries, states, regions, are changing what timezone and when. It is easy to get the UTC Offset of the server and do math but still kind of a hassle. Anyway that has been my pains with the time zones and DST hope that gives you some kind of insight into what at least I would want and how I would use them. Oh yeah and do not even throw parts of India in there with their times off not a normal hour but by half hours that’s even a more brutal calculation.&lt;br&gt;&lt;br&gt;I will check out the new sample you have and see how different that is from mine. I think the primary difference is I made my own config files for the when certain places changed times or if they did or didn’t. Oh yeah I know the best thing would be to tell the customer to change and add the UTC offset to the flat files we get. But they are way bigger than us and the answer we pretty much get is that is our standard of doing it. We would love to get this stuff in XML format but I do not see it happening anytime soon.&lt;br&gt;</description></item><item><title>re: Time Zones in the .NET Framework [AMoore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#567479</link><pubDate>Mon, 03 Apr 2006 21:45:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:567479</guid><dc:creator>Michael Vanhoutte</dc:creator><description>Everything that you've mentioned would be cool, but honestly... the ability to convert a UTC date to any TimeZone would already cover 99% of my needs. &lt;br&gt;Of course, the DateTime structure should have some knowledge of which TimeZone it is in, but it shouldn't be a huge problem if this proves to be too difficult. The work-around would be to ensure that one always moves dates around in UTC and only converts them to a specific TimeZone for display purposes. That does come without a performance cost of course, but it would be doable.&lt;br&gt;The ability to add custom timezones using code or configuration files would be nice as well.&lt;br&gt;&lt;br&gt;By the way, on a sidenote: finally, finally, finally :-)</description></item><item><title>Time zones make me cringe</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#567503</link><pubDate>Mon, 03 Apr 2006 22:13:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:567503</guid><dc:creator>Sorting It All Out</dc:creator><description>I did talk about a particular time zone issue earlier today....&lt;br&gt;And I see that Anthony posted about...</description></item><item><title>re: Time Zones in the .NET Framework [AMoore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#568049</link><pubDate>Tue, 04 Apr 2006 15:01:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:568049</guid><dc:creator>Henry Boehlert</dc:creator><description>I remember I was utterly surprised about System.DateTime having no support for timezones.&lt;br&gt;&lt;br&gt;I consider the original timezone offset being part of the precision of a date/time value. &lt;br&gt;&lt;br&gt;I'd want a future DateTime data type to correctly support round-tripping (ToString-&amp;gt;[Try]Parse in a different TZ) almost all date/time formats found on the web today, including but not limited to the formats used by HTTP/RSS/RDF/ATOM and XML Schema.&lt;br&gt;&lt;br&gt;There's a nice write-up at &lt;a rel="nofollow" target="_new" href="http://www.hackcraft.net/web/datetime/"&gt;http://www.hackcraft.net/web/datetime/&lt;/a&gt;.&lt;br&gt;&lt;br&gt;But then again, the large cross-section with localization, e.g. names of days, months, time zones, might make the implementation a real nightmare.</description></item><item><title>re: Time Zones in the .NET Framework [AMoore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#568275</link><pubDate>Tue, 04 Apr 2006 20:30:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:568275</guid><dc:creator>Robert Schroeder</dc:creator><description>Somewhat related:&lt;br&gt;&lt;br&gt;Using System.Diagnostic.EventLog.WriteEntry(source, message)&lt;br&gt;&lt;br&gt;...if I am writing messages using a common source, and using the static method, and not concerning myself with initing, opening, closing endIniting the source, the dates of the log entries jump forward one hour when the time changes.&lt;br&gt;This is a minor concern for our application, but if there was some more information on exactly what is causing this, I would be interested.&lt;br&gt;&lt;br&gt;On another topic, I would have thought that&lt;br&gt;&lt;br&gt;DateTime dt1 = DateTime.Now().ToUniniversalTime()&lt;br&gt;&lt;br&gt;would equal&lt;br&gt;&lt;br&gt;DateTime dt2 = dt1.ToUniversalTime()&lt;br&gt;&lt;br&gt;...but it doesn't.&lt;br&gt;&lt;br&gt;As Michael Kaplan echoes Raymond Chen, the complexities here are unintuitive and the problems vary by domain. Good luck in getting this right AND making it interoperate with legacy code.</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#568439</link><pubDate>Tue, 04 Apr 2006 23:56:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:568439</guid><dc:creator>Maurits</dc:creator><description>&amp;gt; People are often not specific when they request Time Zone support&lt;br&gt;&lt;br&gt;Please support the tz database syntax&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://www.twinsun.com/tz/tz-link.htm"&gt;http://www.twinsun.com/tz/tz-link.htm&lt;/a&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="ftp://elsie.nci.nih.gov/pub/"&gt;ftp://elsie.nci.nih.gov/pub/&lt;/a&gt;</description></item><item><title>Relaunching the BCL Weblog [Kathy Kam]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#568541</link><pubDate>Wed, 05 Apr 2006 02:50:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:568541</guid><dc:creator>BCLTeam's WebLog</dc:creator><description>We’ve taken a break on blogging since shipping Whidbey. As our team is gearing up for Orcas, we decided...</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#571355</link><pubDate>Sat, 08 Apr 2006 08:29:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:571355</guid><dc:creator>Jason Beaudreau</dc:creator><description>This will be a welcome addition to the Framework. &amp;nbsp;I'm the IT Director for a major relocation company and our business is going global in a big way right now. &amp;nbsp;&lt;br&gt;&lt;br&gt;Increased support for time zones would really be a nice touch and would save us money (since my programmers wouldn't have to write or support the code). &amp;nbsp;In the meantime, I'll take a look at that demo app.&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#571514</link><pubDate>Sat, 08 Apr 2006 16:40:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:571514</guid><dc:creator>cicorias</dc:creator><description>One scenario to consider is converting a time from say UTC to another timezone in the past. &amp;nbsp;Sounds simple, but what happens if the zone that you're converting to has in the interim changed whether they support DST or even their timezone?&lt;br&gt;&lt;br&gt;This happens, and would required a full tracking of each timezone legislative change. &amp;nbsp;In the US, we've modified the date of when DST starts/stops on several occassions and it's up for change again. &amp;nbsp;Within the US, parts of Indiana &lt;br&gt;&lt;br&gt;I've always thought that the &amp;quot;local&amp;quot; timezone of the participant of the Transaction needs to be recorded alongside the &amp;quot;server&amp;quot; timestamp. &amp;nbsp;This gives me a persisted view of what the situation was at the time of transaction. &amp;nbsp;If I only have 1 date to work from and it's in the past, there's no guarantee that it will be the correct TZ conversion unless the underlying libraries keep track of all the law updates per timezone and location.</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#572046</link><pubDate>Sun, 09 Apr 2006 23:49:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:572046</guid><dc:creator>Jim Monty</dc:creator><description>Matthew van Eerde (Maurits) suggests you &amp;quot;support the tz database syntax&amp;quot; and, without elaborating, provides links to the tz database Web page.&lt;br&gt;&lt;br&gt;One cannot write software that correctly handles world time zones and daylight saving times (summer times) without a complete, well-maintained database of those data, which are Byzantine. The only such database that exists and can be called authoritative is the tz database, commonly refered to as the Olson database. As the Web page explains, &amp;quot;This database (often called tz or zoneinfo) is used by several implementations, including the GNU C Library used in GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, HP-UX, IRIX, Mac OS X, OpenVMS, Solaris, Tru64, and UnixWare.&amp;quot; In other words, almost everything but Windows.&lt;br&gt;&lt;br&gt;The C# code posted here includes comments like this: &amp;quot;In southern hemisphere, the daylight saving time starts later in the year, and ends in the beginning of next year. Note, the summer in the southern hemisphere begins late in the year.&amp;quot; And this: &amp;quot;In northern hemisphere, the daylight saving time starts in the middle of the year.&amp;quot; Even if there's some strange truth behind these oddly-worded observations, they have no meaningful relationship to time zone boundaries or daylight saving time conventions. Nothing time zone-wise happens universally in either hemisphere. I'm not sure what the code is attempting to do, or how.&lt;br&gt;</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#575542</link><pubDate>Thu, 13 Apr 2006 08:54:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:575542</guid><dc:creator>Anthony Moore</dc:creator><description>Thanks very much everyone for this great feedback. We can apply this directly to decisions about which scenarios within the feature to do and how to prioritize them.&lt;br&gt;&lt;br&gt;In particular, it is interesting to see the priority placed on serializing a set of time zone data, and making the system extensible enough to support something like Olson.&lt;br&gt;&lt;br&gt;Responses to some specific feedback:&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;On another topic, I would have thought that &lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;DateTime dt1 = DateTime.Now().ToUniniversalTime() &lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; would equal &lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; DateTime dt2 = dt1.ToUniversalTime() &lt;br&gt;&lt;br&gt;That would equal DateTime.UtcNow, but the call to DateTime.Now clobbers the original date.&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; The C# code posted here includes comments like this: &amp;quot;In southern hemisphere, the daylight saving time starts later in the year, and ends in the beginning of next year. Note, the summer in the southern hemisphere begins late in the year.&amp;quot; &lt;br&gt;&lt;br&gt;This comment is merely indicating that you need to account for situations where DST starts later in the year and finishes early in the next year, so you will notice the range comparison needs to differ. This usually happens in the Southern hemisphere, but this is logic based on the data and not a heuristic or guess.&lt;br&gt;&lt;br&gt;Thanks again for your feedback on this topic. Please keep it coming to help us build a better feature!&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#579258</link><pubDate>Wed, 19 Apr 2006 22:16:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:579258</guid><dc:creator>Robert Schroeder</dc:creator><description>Thanks for the reply.&lt;br&gt;&lt;br&gt;I understand what happens - DateTime has no indication of TimeZone, so it always assumes that &amp;quot;ToUniversalTime() is a local timezone and simply applies the offset.&lt;br&gt;&lt;br&gt;Perhaps a better example to show what I mean is that:&lt;br&gt;&lt;br&gt;DateTime.UtcNow != DateTime.UtcNow.ToUniversalTime()&lt;br&gt;&lt;br&gt;// Even though it is already Universal time, it still re-evaluates. This is obvious if you know the limitations of the class, but not obvious from the method name to a casual user. No big deal, just thought I would point out that in actual code I was writing, I tried converting things to UTC for comparisons, not concerning myself if it had already been done, and it turned out, obviously, incorrect.</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#579266</link><pubDate>Wed, 19 Apr 2006 22:28:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:579266</guid><dc:creator>Katy King</dc:creator><description>&amp;gt; DateTime.UtcNow != DateTime.UtcNow.ToUniversalTime() &lt;br&gt;&lt;br&gt;This was true in v1.1. &amp;nbsp;In v2.0, calls to ToUniversalTime() and ToLocalTime() are idempotent. &amp;nbsp;Calling ToUniversalTime() on DateTime.UtcNow should not change the value at all. &amp;nbsp;Calling ToUniversalTime on DateTime.Now will convert the value the first time, but future calls will not change the time again.&lt;br&gt;&lt;br&gt;(For that specific line, you are evaluating UtcNow twice, so they will be somewhat different. &amp;nbsp;But I don't think that's what you're referring to.)&lt;br&gt;&lt;br&gt;Katy King&lt;br&gt;BCL Test&lt;br&gt;</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#584945</link><pubDate>Thu, 27 Apr 2006 13:10:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:584945</guid><dc:creator>Richard Costall</dc:creator><description>The ability to have a site hosted on a server (say in the us) return the date/time &amp;nbsp;for a specifed time zone (including daylight saving time)&lt;br&gt;&lt;br&gt;thanks</description></item><item><title>re: Time Zones in the .NET Framework [Anthony Moore]</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#585514</link><pubDate>Fri, 28 Apr 2006 01:43:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:585514</guid><dc:creator>a</dc:creator><description>a</description></item><item><title>.NET Resources</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#591371</link><pubDate>Sat, 06 May 2006 11:29:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:591371</guid><dc:creator>mattonsoftware.com</dc:creator><description>The following links to .NET resources have been collated over time with the assistance of colleagues.&amp;amp;amp;nbsp;...</description></item><item><title>Software Information &amp;raquo; BCL Team Blog : Exploring Windows Time Zones with System.TimeZoneInfo &amp;#8230;</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#7244983</link><pubDate>Fri, 25 Jan 2008 22:15:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7244983</guid><dc:creator>Software Information » BCL Team Blog : Exploring Windows Time Zones with System.TimeZoneInfo …</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://softwareinformation.247blogging.info/bcl-team-blog-exploring-windows-time-zones-with-systemtimezoneinfo/"&gt;http://softwareinformation.247blogging.info/bcl-team-blog-exploring-windows-time-zones-with-systemtimezoneinfo/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> BCL Team Blog Time Zones in the NET Framework Anthony Moore | Quick Diets</title><link>http://blogs.msdn.com/bclteam/archive/2006/04/03/567119.aspx#9723108</link><pubDate>Wed, 10 Jun 2009 06:38:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9723108</guid><dc:creator> BCL Team Blog Time Zones in the NET Framework Anthony Moore | Quick Diets</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://quickdietsite.info/story.php?id=13358"&gt;http://quickdietsite.info/story.php?id=13358&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>