nus-cs2103-AY2324S2 / forum

16 stars 0 forks source link

Query on format errors #972

Closed bryanyee33 closed 6 months ago

bryanyee33 commented 6 months ago

image

May I ask for this example given for Specificity of error message, why is 2021-13-28 considered as a format error, and not an invalid input? Shouldn't format error be related only to the format of the input, i.e. YYYY-MM-DD, meaning an input such as 2021/02/30 is a format error but not an invalid input, since the format is wrong but it is a valid date?

damithc commented 6 months ago

@bryanyee33 depends on how you specify the format. Here, we assume the format already specifies that MM should be 1..12