It would look like T345701: Wikimedia\Timestamp\TimestampException: Wikimedia\Timestamp\ConvertibleTimestamp::setTimestamp: Invalid timestamp format. is applicable to basically all versions of the library, as the line has been unchanged since it was forked into a library - R1985:b4c8d54d019c: Initial commit from MediaWiki core
T347759: Release v4.1.1 of Timestamp created the new release.
Updating MW 1.39 from v4.0.0 to v4.1.1 and MW 1.40 from v4.1.0 to v4.1.1 (same as master) is trivial.
https://github.com/wikimedia/mediawiki-libs-Timestamp/compare/v4.0.0...v4.1.1
https://github.com/wikimedia/mediawiki-libs-Timestamp/compare/v4.1.0...v4.1.1
Updating MW 1.35 from v3.0.0 to v4.1.1should be doable, without any relevant breaking changes... So probably the easiest way. XMPReader depends on it, but the dependancy is pretty loose already...isn't doable due to an incompatible PHP version changes in the v4.0.0. A v3.0.1 release could be made, or we don't bother backporting...
https://github.com/wikimedia/mediawiki-libs-Timestamp/compare/v3.0.0...v4.0.0