calculate seconds