• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading date from excel file

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

I am trying to read a date from excel file.
The category of the column is General.
In the date value is stored as 20090625 which i want to interpret as 25th June 2009.

When i am trying to read and print this value in java class, i am getting a wrong value as mentioned in the below log,
input docDate in String Format : 2.0090625E7

I can use the String manipulation functions to format the date according to my requirement but i guess there will be more precise approach for this.

Kindly suggest me about the right approach to read a date from excel sheet.

Thanks and Regards,
Vijay Bhore
24632268
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there.

The so-called date is read in as an integer or long. You need to convert that into a string array to get the proper year, month and day. You can use Integer.toString(some_int) to make the data into a string. From here, you need to cater the output.

 
Screaming fools! It's nothing more than a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic