2

I want to store time fields in Eve's schema. For example I would like to have a start_time field and end_time field. But Python Eve only provides datetime type.

Is there any way to store a time in Python Eve, as I don't want Date included in the field?

d3corator
  • 1,154
  • 1
  • 9
  • 23

2 Answers2

0

use time.time(). it gives you the current time as the number of seconds since the epoch in float type. get this value before and after and the difference is the time duration. multiply the difference by 100000 to scale it to microseconds.

Skaperen
  • 453
  • 4
  • 13
0

Difference between two datetime objects is the time difference, which you may be able to store in an integer field with some quick arithmetic.

Anuvrat Parashar
  • 2,960
  • 5
  • 28
  • 55