Kind of follow-up to T11947, it would be very practical to have variables returning the expiration date for a protection, e.g. {{PROTECTIONEXPIRY:edit}}, and returning indefinite if the protection is indefinite.
Expiries are often forgotten in protection templates, or wrongly applied. This would make the precision of expiry automated.