0

How can I subtract on datefield from another and get result in integer?

Like 11.05.2015-10.05.2015 will return 1

I tried entry.start_devation= each.start_on_fact - timedelta(days=data.calendar_start)

Uasmi Nasser
  • 65
  • 1
  • 7

1 Answers1

0

Take the difference between two dates, which is a timedelta, and ask for the days attribute of that timedelta.

Scott Hunter
  • 46,905
  • 10
  • 55
  • 92