fastexcel icon indicating copy to clipboard operation
fastexcel copied to clipboard

ZonedDateTime isn't converted to correct time zone

Open gpsfl opened this issue 1 year ago • 0 comments

A call to value(int r, int c, ZonedDateTime value) should write the time in the correct time zone. Right now it always writes the date in the system time zone. This worked correctly in previous versions.

From what I can tell the issue came from this commit: https://github.com/dhatim/fastexcel/commit/e0e4156184b53530372fa61339f205147fa33bdf

Before the convertDate method had a time zone parameter and was called with the time zone of the ZonedDateTime. Now it's only called with a date.

I think the easiest way to fix this would be to convert the ZonedDateTime using .toLocalDateTime() and then call the convertDate(LocalDateTime date) method.

gpsfl avatar Jun 23 '23 08:06 gpsfl