poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <apa...@gagravarr.org>
Subject Re: Fwd: Clarification on Actual Date from Excel
Date Thu, 08 Jun 2017 08:24:27 GMT
On Thu, 8 Jun 2017, sridhar vr wrote:
> We are working on a requirement. where in excel the value is 05/06/2017,
> but while retrieving the values comes as 05-Jun-2017.

That looks correct to me! It also would look correct to most of the world 
too... See the handy map on 
https://en.wikipedia.org/wiki/Date_format_by_country

> The format is not standard(05/06/2017) for us it may come in any
> format(dynamic), so I cant use dateformatter as well.
>
> But I want to get the actual date as 05/06/2017 from the system.

Simplest would be to check if the cell is a date cell, then fetch the cell 
value as a Java date, and finally format that in Java however you really 
wanted the date format to be

You'll want
  * DateUtil.isCellDateFormatted(cell)
  * cell.getDateCellValue()

Nick

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


Mime
View raw message