Hi Jakub & Nick
Thank you very much for your reply.
Today I tried again with SimpleDateFormat and I am getting the time that I
want.
I need to get it in the format KK:mm:ss:SS
K Hour in am/pm (0-11)
So I read about the java date formats and I am glad that I made it with the
help of you both.
Next step that I will have to learn how to convert excel 95 to excel 97.
Thank you very much to you both.
Maria
jakub kuzela wrote:
>
> Sorry i think u are able to working with date in java:
>
> java.text.SimpleDateFormat sdf = new
> java.text.SimpleDateFormat("hh.mm.ss.SS");
> System.out.println(sdf.format(readDate));
>
> http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
>
> Jakub.
>
> 2008/4/14, mariag <[EMAIL PROTECTED]>:
>>
>>
>> Hi Jakub,
>> Thank you for your reply.
>>
>> I used the code and I am getting the output as
>>
>> DATE IS: Sun Dec 31 00:01:05 EST 1899
>>
>> But, I would like to get the same time as in the cell as 00:01:05.13 and
>> is
>> formatted as hh\:mm\:ss.00.
>>
>> Please help me to get the time.
>>
>> Thanks,
>> Maria
>>
>>
>>
>> jakub kuzela wrote:
>> >
>> > Hi,
>> >
>> > if you want create cell with format hh:mm:ss.00 u can do this:
>> >
>> > HSSFCellStyle cellData = wb.createCellStyle();
>> > HSSFDataFormat formatData = wb.createDataFormat();
>> > cellData.setDataFormat(formatData.getFormat("hh:mm:ss.00"));
>> >
>> > HSSFWorkbook wb = new HSSFWorkbook();
>> > HSSFSheet sheet = wb.createSheet("new sheet");
>> > HSSFRow row = sheet.createRow((short)0);
>> >
>> > cell = row.createCell((short)1);
>> > cell.setCellStyle(cellStyle);
>> > java.util.Date utilDate = new java.util.Date();
>> > cell.setCellValue(utilDate);
>> >
>> > if you want read this cell back you can do this:
>> >
>> > InputStream inp = new FileInputStream("D:/workbook.xls");
>> >
>> > wb = new HSSFWorkbook(new POIFSFileSystem(inp));
>> > sheet = wb.getSheet("new sheet");
>> > row = sheet.getRow((short)0);
>> > cell = row.getCell((short)1);
>> >
>> > java.util.Date readDate = cell.getDateCellValue();
>> > System.out.println("DATE IS: "+readDate);
>> >
>> > Is this what you ask?
>> >
>> > Jakub.
>> >
>> >
>> >
>> > 2008/4/14, Nick Burch <[EMAIL PROTECTED]>:
>> >>
>> >> On Fri, 11 Apr 2008, mariag wrote:
>> >>
>> >> > I am new to this HSSF. I have an urgent requirement to read an excel
>> >> > file.
>> >> > But it has a time field that I don't know how to read it.
>> >> >
>> >> > Can anyone please help me in reading a date cell with excel custom
>> >> > format hh\:mm\:ss.00? if I have the value in the cell as
>> >> 00.00.18.13,excel is displaying itas 12:00:18 AM.
>> >> >
>> >>
>> >> I'm not sure quite what you're after, but have you tried reading:
>> >> http://poi.apache.org/hssf/quick-guide.html#CreateDateCells
>> >> http://poi.apache.org/hssf/quick-guide.html#DataFormats
>> >> ?
>> >>
>> >> Nick
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/read-custom-format-date-hh%3Amm%3Ass%3A00%E2%80%8F-tp16628223p16677658.html
>> Sent from the POI - User mailing list archive at Nabble.com.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/read-custom-format-date-hh%3Amm%3Ass%3A00%E2%80%8F-tp16628223p16687666.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]