Added function to take time and return in decimal