“2021-01-01” is, as the error says, a String. It’s not a ZonedDateTime. You can’t just type in a String and have it magically become something else. You have to convert that String into a ZonedDateTime. And then you can get at the seconds and do the math with that.