Return-Path: Delivered-To: apmail-jakarta-poi-user-archive@www.apache.org Received: (qmail 80591 invoked from network); 25 Nov 2003 18:35:54 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 25 Nov 2003 18:35:54 -0000 Received: (qmail 3947 invoked by uid 500); 25 Nov 2003 18:21:39 -0000 Delivered-To: apmail-jakarta-poi-user-archive@jakarta.apache.org Received: (qmail 3932 invoked by uid 500); 25 Nov 2003 18:21:39 -0000 Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "POI Users List" Reply-To: "POI Users List" Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 3901 invoked from network); 25 Nov 2003 18:21:38 -0000 Received: from unknown (HELO geriatrix.itellix.net) (203.145.183.216) by daedalus.apache.org with SMTP; 25 Nov 2003 18:21:38 -0000 Received: from localhost (getafix.dm.itellix.net [10.0.1.2]) by geriatrix.itellix.net (Postfix) with ESMTP id 7CA45430F98 for ; Tue, 25 Nov 2003 23:31:47 +0530 (IST) Received: from 202.88.159.118 ([202.88.159.118]) by www.itellix.net (IMP) with HTTP for ; Wed, 26 Nov 2003 00:28:22 +051800 Message-ID: <1069786702.3fc3a64ed0d54@www.itellix.net> Date: Wed, 26 Nov 2003 00:28:22 +051800 From: avik.sengupta@itellix.com To: POI Users List Subject: Re: AW: setCellValue(Date) is displayed ahead by 1 day and 4 years References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-WebMail-Company: Itellix X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 : > 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" 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