Based on the regulation that is defined in the RTS for SCA & CSC (EUR-Lex - 02018R0389-20230912 - EN - EUR-Lex ) you can find in Article 10 the following rule:
There you can find in 2. (b)
payment service providers shall not be exempted from the application of strong customer authentication where […] (b) more than 180 days have elapsed since the last time the payment service user accessed online the information specified in paragraph 1 and strong customer authentication was applied.
That allows a PSP to create recurring consents that can be used without additional SCA for at max 180 days.
If the consent would e.g. be established on 01.01.2020 at 14:00 and the validUntil would allow for 180(days) then a TPP would still be able to execute an AIS request based on this consent on 29.006.2020 at 16:00 which is longer than 180 days and thus contradicting the law.
That is why you can create recurring consents only with validUntil = today + 179 days.
In case you don’t want to calculate that but always use the maximum possible date, then you can use the following and the valid until date is set to the maximum automatically:
"validUntil": "9999-12-31”.