title: Converting timestamp float to datetime in Python3
body: <p>I have timestamps as floats, which I want to convert to datetime objects.
  Example:
  20050101.47916667 would be the time 2005-01-01 11:30:00</p>
  <p>Using the code:</p>
  <pre><code>import datetime
      print(datetime.datetime.fromtimestamp(20050101.47916667))
  </code></pre>
  <p>Results in the output:</p>
  <pre><code>1970-08-21 02:28:21.479167
  </code></pre>
  <p>How can I convert my float to the right datetime?</p>
  <p>Edit: My full code is the following, as I am trying to create a timeseries with the date in the right format on the x-axis:</p>
  <pre><code>import matplotlib.pyplot as plt
  import matplotlib.gridspec as gridspec
  import matplotlib.colors as mcolors
  from datetime import datetime, timedelta
  from netCDF4 import Dataset
  import numpy as np
  
  fig,axs = plt.subplots(2,1,squeeze=True)
  
  a = Dataset('control1.nc')
  a2 = Dataset('affor1.nc')
  a3 = Dataset('control2.nc')
  a4 = Dataset('affor2.nc')
  
  my_time = a.variables['Times'][:]   
  V10 = a.variables['V10'][:,0,0]
  
  my_time2 = a2.variables['Times'][:]
  V10_2 = a2.variables['V10'][:,0,0]
  
  my_time3 = a3.variables['Times'][:]
  V10_3 = a3.variables['V10'][:,0,0]
  
  my_time4 = a4.variables['Times'][:]
  V10_4 = a4.variables['V10'][:,0,0]
  
  x1 = my_time
  x2 = my_time2
  x3 = my_time3
  x4 = my_time4
  y1 = V10
  y2 = V10_2
  y3 = V10_3
  y4 = V10_4
  
  axs[0].plot(x1,y1, marker='', color='red', linewidth=1, label='Control WGP2')
  axs[0].plot(x2,y2, marker='', color='blue', linewidth=1, label='Afforestation WGP2')
  axs[1].plot(x3,y3, marker='', color='magenta', linewidth=1, label='Control WGP4')
  axs[1].plot(x4,y4, marker='', color='black', linewidth=1, label='Afforestation WGP4')
  
  axs[0].legend()
  axs[1].legend()
  axs[0].set_title('January 2005',loc='center')
  axs[0].set_xlabel('Date')
  axs[1].set_xlabel('Date')
  axs[0].set_ylabel('Wind gusts (m/s)')
  axs[1].set_ylabel('Wind gusts (m/s)')
  
  for ax in axs.flat:
      ax.label_outer()
  
  plt.show()
  </code></pre>
  <p>Both variables (V10 and time) are arrays, example:</p>
  <pre><code>[20050101.47916667 20050102.47916667 20050103.47916667 20050104.47916667
   20050105.47916667 20050106.47916667 20050107.47916667 20050108.47916667
   20050109.47916667 20050110.47916667 20050111.47916667 20050112.47916667
   20050113.47916667 20050114.47916667 20050115.47916667 20050116.47916667
   20050117.47916667 20050118.47916667 20050119.47916667 20050120.47916667
   20050121.47916667 20050122.47916667 20050123.47916667 20050124.47916667
   20050125.47916667 20050126.47916667 20050127.47916667 20050128.47916667
   20050129.47916667 20050130.47916667 20050131.47916667]
  </code></pre>