As per the time string parsing code in [0], we're using 'yyyy' instead of 
'YYYY'.
```
simpleDateFormat.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
```

Therefore, I agree with David that this is simply a documentation error. It can 
be resolved without the need for a KIP.

[0] 
https://github.com/apache/kafka/blob/6fa5537ceb035a01639aa6361a62148fe85a2c82/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L1525

Best,
Chia-Ping

On 2025/01/09 08:05:43 Tommi Vainikainen wrote:
> Hi,
> 
> In my opinion the documentation should not follow the notation of Java
> library formatter, but simply ISO 8601 format. The standard ISO 8601 format
> would be actually 'YYYY-MM-DDThh:mm:ss.sss' (lower case hours and seconds).
> 
> The documentation is for Kafka users, and Kafka users do not need to know
> details of the Java library. ISO standard instead is a more widely used
> notation of time format.
> 
> On Thu, Jan 9, 2025 at 9:07 AM David Jacot <dja...@confluent.io.invalid>
> wrote:
> 
> > Hi Kirk,
> >
> > Thanks for raising this. In this case, the documentation is wrong so, in my
> > opinion, we could just fix it.
> >
> > Best,
> > David
> >
> > On Thu, Jan 9, 2025 at 2:52 AM Kirk True <k...@kirktrue.pro> wrote:
> >
> > > Hi all,
> > >
> > > Do we consider the CLI help/usage message as part of the publicly
> > > documented API?
> > >
> > > Background: There's a bug in the help/usage message in some of the Kafka
> > > CLI tools. For some of the tools that accept a timestamp, the help
> > message
> > > instructs the user to provide a date in a 'YYYY-MM-DDTHH:mm:SS.sss'
> > format.
> > >
> > > However, that format is incorrect:
> > >
> > > - YYYY refers to the "week year" not the year (see
> > >
> > https://medium.com/@dangoldin/javas-simpledateformat-yyyy-vs-yyyy-f3e785523589
> > > )
> > > - SS refers to milliseconds, not seconds
> > > - sss refers to seconds, not milliseconds
> > >
> > > It's a small thing, but it did lead to some confusion and it would be
> > good
> > > to clean it up.
> > >
> > > Thanks,
> > > Kirk
> > >
> >
> 

Reply via email to