https://bz.apache.org/bugzilla/show_bug.cgi?id=69681
Bug ID: 69681 Summary: Issue with date format ending with ".000 AM/PM" (a date format ending with milliseconds + AM/PM with a space in between). Product: POI Version: 5.4.1-FINAL Hardware: PC Status: NEW Severity: normal Priority: P2 Component: XSSF Assignee: dev@poi.apache.org Reporter: cedric.all...@nasdaq.com Target Milestone: --- Created attachment 40039 --> https://bz.apache.org/bugzilla/attachment.cgi?id=40039&action=edit Test code to reproduce the issue We found an issue in POI, when we use a date format ending with ".000 AM/PM" (a date format ending with milliseconds + AM/PM with a space in between). In this case POI do not recognize the cell style as a date style in the process of auto sizing columns. Because of this the column is too small for the displaying value after auto resizing. I attach a sample code showing the issue, the output of this sample code is. Cell with format "DD MMMM, YYYY hh:mm:ss.000 AM/PM" is date formatted : false Column width after autoresize: 1411 Formatted Cell Value: 45771 Cell with format "DD MMMM, YYYY hh:mm:ss.000AM/PM" is date formatted : true Column width after autoresize: 6165 Formatted Cell Value: 24 April, 2025 12:00:00.000AM We see the date format with space between milliseconds and AM/PM is not recognized as a Date but a numeric, the auto sizing set the column width based on the numeric value. Without the space then the style is recognized as a Date style and the width is correct after auto sizing. We also see the DataFormatter do not recognize the format as date format. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org