calculate timetype