def __preptime(self,when):  
  """ 
  Extract information in a suitable format from when,  
  a datetime.datetime object. 
  """  
  # datetime days are numbered in the Gregorian calendar  
  # while the calculations from NOAA are distibuted as  
  # OpenOffice spreadsheets with days numbered from  
  # 1/1/1900. The difference are those numbers taken for   
  # 18/12/2010  
  self.day = when.toordinal()-(734124-40529)  
  t=when.time()  
  self.time= (t.hour + t.minute/60.0 + t.second/3600.0)/24.0  
    
  self.timezone=self.tzoffset
 
  Extract information in a suitable format from when,  
  a datetime.datetime object. 
  
p_weather/sunrise.py