-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Description
I would really appreciate some help, because I haven't figured out how to do this for half a day now.
I tried to do according to the cell API
Calendar calendar = Calendar.getInstance();
calendar.setTime(myDate);
cell.setDateValue(calendar);
But I'm losing hour and minute information.
This is what I get in the cell: 8.02.2024 00:00:00
If I try to set the time (cell.setTimeValue), I lose the date information in the cell (30.12.1899 16:50:12).
Then I tried to do it all on my own (actually tried to replicate the code in setDateValue or 'setTimeValue'), like this:
String date = new SimpleDateFormat(format).format(value);
TableTableCellElementBase element = cell.getOdfElement();
element.setOfficeValueTypeAttribute(OfficeValueTypeAttribute.Value.DATE.toString());
element.setOfficeDateValueAttribute(date);
cell.setDisplayText(date);
But that doesn't work either... Default DateTime in the cell 30.12.1899 00:00:00
Anyway, it would be great if someone could help me out, please...
I just need to get DateTime together
(im using 0.9 version btw)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels