<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Coding the Architecture - timezone tag</title>
  <link>http://www.codingthearchitecture.com/tags/timezone/</link>
  <description>Software architecture for developers</description>
  <language>en</language>
  <copyright>Coding the Architecture</copyright>
  <lastBuildDate>Mon, 21 May 2012 09:41:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Time zones</title>
    <link>http://www.codingthearchitecture.com/2007/07/24/time_zones.html</link>
    
      
        <description>
          &lt;p&gt;
When I start a new project, I can be sure that there are always a number of common tasks that need to happen. These include defining document templates, the source code structure, a build file, the development environment, the continuous integration environment, common frameworks/libraries, etc. These are known quantities and they are something that I typically plan for. One aspect of a system that always catches me out, however, is time zones.
&lt;/p&gt;

&lt;p&gt;
From a Java perspective, time zones are actually pretty easy to deal with. The built-in date API might not be that intuitive, but at least it&#039;s fairly easy to get to grips with. For example, if I want to be sure that I represent local time in London, I can use the following code to create a &lt;code&gt;Calendar&lt;/code&gt;.
&lt;/p&gt;

&lt;pre class=&#034;codeSample&#034;&gt;
Calendar cal = Calendar.getInstance(
  TimeZone.getTimeZone(&#034;Europe/London&#034;));
&lt;/pre&gt;

&lt;p&gt;
Provided that you remember to explicitly specify a time zone whenever you are creating or formatting dates, you should have very few problems. Of course, it&#039;s all very well actually knowing this, but time zone management is always something that I overlook until something starts misbehaving. Typical triggers include :
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deploying the system to a server running in a different time zone (e.g. usually GMT all year round).&lt;/li&gt;
&lt;li&gt;Working with a physically separated team.&lt;/li&gt;
&lt;li&gt;Daylight saving changes during the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
As an architect though, you have to look at things from a wider perspective than just the application tier, and this is when it can start to get tricky. For example, what happens when your application tier and database are running in different time zones? Do you ensure the application tier sends all date/times in a specific time zone (e.g. GMT) or rely on the database defaults? What if your database vendor allows time zone information to be stored alongside any date/times, do you use this feature? What if they don&#039;t? What happens if clients are connecting to your application from all over the world and sending you dates?
&lt;/p&gt;

&lt;p&gt;
And it doesn&#039;t stop at the implementation of the system itself. If you&#039;re planning to deploy your system across multiple sites or countries, what do you do then? What if that deployment is active-passive; should you plan to test the DR and BCP environments?
&lt;/p&gt;

&lt;p&gt;
Time zone management seems like a pretty trivial detail, but it can easily have wider implications and has played a part in every project and every architecture that I&#039;ve been involved in for the last couple of years. As we build more and more systems that break down traditional geographical barriers, projects need to have somebody to look after this type of detail. For me, that&#039;s part of the architect&#039;s role.
&lt;/p&gt;
        </description>
      
      
    
    
    
    <category>How do you define software architecture?</category>
    
    <comments>http://www.codingthearchitecture.com/2007/07/24/time_zones.html#comments</comments>
    <guid isPermaLink="true">http://www.codingthearchitecture.com/2007/07/24/time_zones.html</guid>
    <pubDate>Tue, 24 Jul 2007 09:52:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>

