How can I get hours from a Python datetime?

后端 未结 2 1103
鱼传尺愫
鱼传尺愫 2021-01-01 10:34

I have a Python datetime, d, and I want to get the number of hours since midnight as a floating point number. The best I\'ve come up with is:

h = ((((d.hour         


        
2条回答
提交回复
热议问题