Convert datetime to float variable

How does one convert from variable c:

c = datetime.now()
datetime.datetime(2018, 1, 13, 18, 4, 44, 76286)

The hours, minutes and seconds to the following float variable:

0.9832523148148148

And how can this be reversed as well?