https://issues.apache.org/bugzilla/show_bug.cgi?id=52928

Yegor Kozlov <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Yegor Kozlov <[email protected]> 2012-03-17 12:39:35 UTC ---
Very cool, applied in r1301923 with some tweaks, junit included.

The testing is tricky. We should not rely on our eyes , you simply don't see 
all the discrepancies if you don't know the locale language. 

To simplify testing I added two more columns: column D is the value returned by
java.text.DateFormat and column E is a formula that returns TRUE if Excel
formatted value in column C equals to its Java counterpart in column D.

The formula looks as follows:
TEXT(C6,G6)=D6

where C6 is date, not matter how it is formatted, excel takes the raw double
value.
G6 is the format applied to the cell style, e.g. [$-41C]yyyy-MM-dd;@
and D6 is a string calculated in Java.

We expect that Excel and Java format equally and the formula in all rows will
return TRUE. Unfortunately it is not so, but it is not a bug, rather MS Office
and Java format locales slightly differently.  See attached example, not
matched rows are marked in red. 

For the future, please consider enhancing this utility to support
bi-directional conversion:
1. from java.text.DateFormat to Excel date pattern
and the other way around
2. from excel date pattern to java.text.DateFormat

The second option is important to properly format excel date cell as a string. 

Regards,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to