code_junkie

Changing the date format

Nov 13th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. XNumberFormatTypes xFormatTypes = (XNumberFormatTypes) UnoRuntime.queryInterface(XNumberFormatTypes.class, xNumberFormats);
  2. int myDateFormat = xNumberFormats.addNew("DD.MM.YY HH:MM:SS AM/PM", defaultLocale);
  3. XPropertySet cellRangePropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, cellRange);
  4. cellRangePropSet.setPropertyValue("NumberFormat", new Integer(myDateFormat));
Add Comment
Please, Sign In to add comment