title: Python Plotting Time
body: <pre><code>time_arr =[1491343400.0, 1491343830.0, 1491344137.0, 1491344322.0, 1491344751.0, 1491412847.0, 1491413092.0, 1491413277.0, 1491413645.0, 1491413952.0, 1491414198.0, 1491414627.0, 1491418003.0, 1491418924.0, 1491419170.0, 1491419907.0, 1491420091.0, 1491421073.0, 1491422915.0, 1491423591.0, 1491423960.0, 1491424389.0, 1491426048.0, 1491426846.0, 1491427890.0, 1491428566.0, 1491428935.0]
  </code></pre>
  
  <p>Hi,</p>
  
  <p>I am trying to plot this time array against a volume one of the same length.  I would like the time in this format 2015-02-18 02:08:12. My problem:</p>
  
  <ol>
  <li><p>Converting these seconds to this format :2015-02-18 02:08:12</p></li>
  <li><p>Using matplotlib to plot TIME and DATES on the x-axis</p></li>
  </ol>
  
  <p>I got this code from the internet, but it only gives the h, m and s:</p>
  
  <pre><code>def format_seconds_to_hhmmss(seconds):
      hours = seconds // (60*60)
      seconds %= (60*60)
      minutes = seconds // 60
      seconds %= 60
      return "%02i:%02i:%02i" % (hours, minutes, seconds)   
  </code></pre>
  
  <p>how do I change this to do what I want?</p>
  
  <p>I would like to use a bar graph.</p>