title: c++ How to find the time in foreign country taking into account daylight saving?
body: <p>Say, if it's 13:00 at new york (EST) , then it's 06:00 at new zealand (NZST).
  If new zealand goes into summer time, then when it's 13:00 at new york (still EST), it's going to be 07:00 at new zealand (now NZDT).</p>
  
  <p>I read the boost time library, but it seems to me one has to determine the daylight saving rules oneself to find out the time in foreign country from the 'localtime' perspective..</p>
  
  <p>e.g.</p>
  
  <pre><code> nyc_string = "EST-05:00:00EDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00";
   // above basically defines the daylight saving rule
   time_zone_ptr nyc_2(new posix_time_zone(nyc_string));
  
   std::cout &lt;&lt; "The second zone is in daylight savings from:\n " 
    &lt;&lt; nyc_2-&gt;dst_local_start_time(2004) &lt;&lt; " through "
    &lt;&lt; nyc_2-&gt;dst_local_end_time(2004) &lt;&lt; std::endl;
  </code></pre>
  
  <p>source: <a href="http://www.boost.org/doc/libs/1_39_0/doc/html/date_time/examples.html" rel="noreferrer">http://www.boost.org/doc/libs/1_39_0/doc/html/date_time/examples.html</a></p>
  
  <p>Maybe there's something I'm not yet aware of? Does boost use any database that keeps track of daylight saving rules? I wonder if there's a nice way to adjust local time to different time zone in c++, taking the daylight saving rules into account..If I could have an example, that'd be so great!</p>