title: Creating a log file name based on the hour during day light saving
body: <p>I am working on a project. The application follows day time saving. </p>
  
  <p>The application creates a log file every hour when running,e.g.</p>
  
  <pre><code>2015042206_someName.log
  </code></pre>
  
  <p>Here 20150422 is the date and 06 is the hour of logging. </p>
  
  <p>When time is changing in winter, there will two time 2 am – you know what I mean. </p>
  
  <p>I want to make two different files for these two different hours by assigning suffix, e.g. </p>
  
  <pre><code>2015042202A_someName.log – File before time change
  2015042202B_someName.log – File after time change
  </code></pre>
  
  <p>One solution I thought of:</p>
  
  <p>Somehow (I don’t know how) get ‘PREVIOUS HOUR’ from the Calendar and see the different between the ‘HOUR_OF_DAY’ and ‘PREVIOUS HOUR’. If the difference is zero then time has changed so put suffix. </p>
  
  <p>In this case, I don’t know how to get the previous hour – especially if the application was not running during the previous hour.</p>
  
  <p>Any other solution anyone can think of???</p>
  
  <p>Any help is appreciated greatly. Thanks in advance. </p>