ExpireTime and PExpireTime should return times instead of durations
Author: costelaCreated Jul 21, 2023Updated Apr 21, 2026
Labelsv10
Expected Behavior
redis.ExpireTime and redis.PExpireTime should return redis.TimeCmd.
Current Behavior
redis.ExpireTime and redis.PExpireTime should return redis.DurationCmd.
Possible Solution
Ideally both functions (intruduced only recently in #2426) would return redis.TimeCmd to avoid the necessary conversion and possible confusion of returning a duration that actually represents an absolute unix timestamp.
This would however break the v9 API :disappointed:
Alternatively, the discrepancy should be clearly explained in the API, warning about the need for conversion.
Source: redis/go-redis