Bug 46411

Summary: Formatting of Excel date values < 1.0 show different date to Excel
Product: POI Reporter: Steven Butler <sebutler>
Component: HSSFAssignee: POI Developers List <dev>
Status: REOPENED ---    
Severity: minor    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Bug Depends on:    
Bug Blocks: 60165    

Description Steven Butler 2008-12-17 04:04:23 UTC
In Excel 2003, when a TIME(h,m,s) value is formatted as a date, or includes a date component.  For example, when TIME(12,0,0) is formatted with the format string "yyyy-mm-dd hh:mm:ss", the date is shown as
1900-01-00 12:00:00 in Excel.

This is obviously not a correct date but it is what Excel does with the value.

POI formats the value as
1899-12-31 12:00:00

which is a valid date, but not the same as the value produced by Excel.
Comment 1 Nikolay Durygin 2014-11-10 11:15:28 UTC
The same issue for Excel 2010. Moreover if you write this date back to Excel - it won't set correct date (because Excel doesn't handle dates before 1900).

Thus when you just read a value and write it back without changing - you get broken data. Can it be considered as a bug? Shouldn't POI handle such cases?

My comment isn't strictly about the initial issue but is very close. Decided to put it here.