Let the application deal with converting time_t to uint64_t. For TOTP, it's just a counter. While there, rename 'granularity' to 'step', as it's used in RFC 6238.