calculate time add and minus