def float2date(date):
"""Convert a float to a string containig a date"""
date = int(date)
year = 1900 + (date / 10000)
month = (date % 10000) / 100
day = date % 100
return '%04d%02d%02d' % (year, month, day)
def float2time(time):
"""Convert a float to a string containig a time"""
time = int(time)
hour = time / 10000
min = (time % 10000) / 100
return '%02d%02d' % (hour, min)
|