poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38641] - [PATCH] Use the calendar's timezone in HSSFCell.setCellValue(Calendar)
Date Thu, 07 Feb 2008 13:23:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38641>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38641





------- Additional Comments From lpoublan@triloggroup.com  2008-02-07 05:23 -------
This bug is annoying when POI is used on the server side, and there are clients
using different time zones.
Currently, there is a workaround, but it would be simple to fix that bug.
Here is the workaround:
  long time=date.getTime();
  TimeZone defaultTZ=TimeZone.getDefault();
  TimeZone usedTZ= [get the timezone to use here]
  int offset=usedTZ.getOffset(time) - defaultTZ.getOffset(time);
		
  if (offset!=0){
    date=new Date(time+offset);
  }
  cell.setCellValue(date);

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

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


Mime
View raw message