You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by av...@itellix.com on 2003/11/04 11:28:22 UTC

Re: AW: setCellValue(Date) is displayed ahead by 1 day and 4 years

The 1 day issue is probably combination of a rounding error plus timezone plus
midnight (00:00) time... could be in POI, could be in your code.. needs
investigation....  

The four years issue is the difference between files created on a Mac vs files
created on a PC. While one uses a 1904 date baseline, the other uses 1900 (or
vice versa.... since its near midnight in my timezone, i shall not tax my brain
to remember which is which) ... 

There is low level record (the "1904" record) that tells you which format the
data is stored in the file. I dont know if/how POI handles this at a higher
level... probably getDateValue should account for this.....

Quoting Sasha Borodin <sa...@whoissasha.com>:

> CST is Central Standard Time (a U.S. Time zone) - but that's just what
> Date.toString() outputs in my locale...it's still just a java.util.Date
> that's being passed to Cell.setCellValue().
> 
> Thanks for your reply.
> 
> -Sasha
> 
> On 11/25/03 10:36 AM, "Mehner, Björn" <Bj...@epos-cs.de> wrote:
> 
> >> HSSFRow header = sheet.getRow((short) 0);
> >> header.createCell((short) 0).setCellValue(aDate);
> >> 
> >> Of course I also create a date style, and set the cell style to that.
> >> 
> >> So for example, this is some debugging (toString) for 3 dates:
> >> 
> >> Sat Nov 01 00:00:00 CST 2003
> >> Sat Nov 15 00:00:00 CST 2003
> >> Sun Nov 16 00:00:00 CST 2003
> > 
> > What on earth is CST? Maybe you are using a timezone Excel cannot deal
> > with?
> > 
> > ciao Bodo
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 





---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org