title: UTC Time to String Conversion
body: <p>I am looking for helping doing time conversions from UTC time to string using MATLAB.</p>
  
  <p>I am trying to extract time from a data file collected at the end of October 2010.
  The data file says it is reporting in UTC time and the field is an integer string value in milliseconds that is around 3.02e11. I would like to convert this to a string but am have some trouble. </p>
  
  <p>I figured out that the units are most definitely in milliseconds so I convert this to fractions of days to be compatible with datenum format.</p>
  
  <p>If the data was collected at the end of October (say, October 31, 2010) then I can guess what kind of number I might get. I thought that January 1, 2001 would be a good epoch and calculated what sort of number (in days) I might get:</p>
  
  <pre><code>suspectedDate = datenum('October 31, 2010')
  suspectedEpoch = datenum('January 1, 2001')
  
  suspectedTimeInDays = suspectedDate - suspectedEpoch
  </code></pre>
  
  <p>Which comes out as <em>3590</em>.</p>
  
  <p>However, my actual time, in days, comes out with the following code</p>
  
  <pre><code>actualTime = 3.02e11
  actualTimeInDays = 3.02e11/1000/24/3600
  </code></pre>
  
  <p>as <em>3495.4</em>.</p>
  
  <p>This is troubling as the difference is only 94.6 -- not a full year. This would mean either the documentation for the file is wrong or the epoch is close to April 1-5, 2001:</p>
  
  <pre><code>calculatedEpoch = suspectedDate - actualTimeInDays
  calculatedEpochStr = datestr(calculatedEpoch) 
  </code></pre>
  
  <p>Alternately, if the epoch is January 1, 2001 then the actual date in the file is from the end of July.</p>
  
  <pre><code>ifEpochIsJanuaryDate = suspectedEpoch + actualTimeInDays
  ifEpochIsJanuaryDateStr = datestr(ifEpochIsJanuaryDate) 
  </code></pre>
  
  <p>Is this a known UTC format and can anyone give suggestions on how to get an October date from 3.02e11 magnitude number?</p>