Added some stuff to convert date to days