Fwd: Clarification on Actual Date from Excel

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Clarification on Actual Date from Excel

sridhar vr
---------- Forwarded message ----------
From: sridhar vr <[hidden email]>
Date: Thu, Jun 8, 2017 at 9:49 AM
Subject: Clarification on Actual Date from Excel
To: [hidden email]


Hi,

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.

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.

Please let me know, if you can guide me.

Any other online example available for VLookup to implement, please guide
as well.

Best
Sridhar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: Clarification on Actual Date from Excel

Nick Burch-2
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: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...