models.py: calculate time span in time series