gettime function

gettime calculates time in seconds passed each day