Hi!
In Calc I set a cell value to "2006/10/03 13:33:55.448" and Calc says it is Standard format. I'm doing this with Java and I want to set the format to "DD.MM.YY HH:MM:SS AM/PM":
XNumberFormatTypes xFormatTypes = (XNumberFormatTypes) UnoRuntime.queryInterface(XNumberFormatTypes.class, xNumberFormats);
int myDateFormat = xNumberFormats.addNew("DD.MM.YY HH:MM:SS AM/PM", defaultLocale);
XPropertySet cellRangePropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, cellRange);
cellRangePropSet.setPropertyValue("NumberFormat", new Integer(myDateFormat));
but the cell stil looks the same. Do I have to refresh the range so that the cell would display "03.10.06 01:33:55 PM"?
[Solved] Changing the date format
[Solved] Changing the date format
Last edited by Villeroy on Tue Jan 13, 2009 5:50 pm, edited 1 time in total.
Reason: Tagged [Solved]
Reason: Tagged [Solved]
OOo 3.0.X on Ubuntu 8.x
Re: Changing the date format
Since the data was imported via CSV file I had to specify that a column is of type 5 in FilterOptions.
OOo 3.0.X on Ubuntu 8.x
Re: Changing the date format
So you had no numbers in the cells and number formatting was pointless with text values. This is why I was clueless about what could be wrong with your code.kovi wrote:Since the data was imported via CSV file I had to specify that a column is of type 5 in FilterOptions.
Thank you for resolving this by your own.
moderation: I'll tag this as [Solved]
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice