In calc, setting a date on a cell from a python macro is very difficult. The cell expects a CDate, a numerical value from some specific offset, but this offset is not known to the user. Furthermore, the value returned by calling getDate() on a DateField is returned as a numerical value in a different format, e.g. 20130313 for 13/03/2013. Converting between these different values is not simple. A workaround for example is to use setFunction instead, using a date string that's manually created by the user, and the function =DATEVALUE. However, this is error prone. Perhaps cell objects could have a setDate value, that could accept a date in different formats, including the ISO 8601 format used by DateFields?
Thank you for reporting this enhancement request! I can confirm that this is a valid enhancement request on: Version 4.1.0.0.alpha0+ (Build ID: b514f0ce86e85d9be269ddf2e797befbbf3423f) Date: Thu Mar 7 21:46:30 2013 +0200 Platform: Bodhi Linux 2.2 x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + As I've been able to confirm the enhancement request I am marking as: New (confirmed) Enhancement Lowest (won't affect many users at all, only would impact our power users) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link: https://wiki.documentfoundation.org/QA/BugTriage There are also other ways to get involved including with marketing, UX, documentation, and of course developing - http://www.libreoffice.org/get-help/mailing-lists/. Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
DateFields now return their value as a UNO com.sun.star.util.Date struct. As to the offset used by Calc, I don't know how to get it, but there should be a way to get it indeed.