[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: Data format
From:       "Javen O'Neal" <javenoneal () gmail ! com>
Date:       2015-11-13 16:47:59
Message-ID: CAM+TppJSWKMT7U8Fv30ya-Bwc7-M=i44GmQgW-ZizWsh6TiZEg () mail ! gmail ! com
[Download RAW message or body]


Thanks. This is what I was looking for. I stumbled across it a few times
but didn't remember the name when I needed it.

I'm a huge fan of ISO 8601 [1] as it makes the locale problem go away. This
would be a good format for Microsoft to adopt as a built-in.

[1] https://xkcd.com/1179/
On 13 Nov 2015 2:49 a.m., "Nick Burch" <apache@gagravarr.org> wrote:

> On Thu, 12 Nov 2015, Javen O'Neal wrote:
>
>> In one POI project I'm working on, I am writing a date to a cell.
>> I'm using
>> CellStyle datetStyle = workbook.createCellStyle();
>> dateStyle.setDataFormat(22);
>>
>> Is there a POI constant that I can use instead of the number 22?
>>
>
> org.apache.poi.ss.usermodel.BuiltinFormats ?
>
> Though it might want extending to expose some of the more common ones in a
> more helpful constant-like way... Several of those get "localised" too,
> showing up as different things depending on the locale of the Excel program
> opening it. eg Format 0xe is defined as m/d/yy, but opening it up on in a
> UK-English Excel shows as dd/mm/yyyy
>
> Maybe we could combine providing more helpful constants with also
> capturing the locale-specific localised versions too? (IIRC it's only these
> built-in formats that get magically localised like that)
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic