Last Modified date in yyyy-MM-dd format in Office documents
Version: Windchill 13.0
Use Case: Display the Last Modified date in yyyy-MM-dd format in Office documents
Description:
Hi All,
I’m reaching out for advice on a challenge I’ve encountered while trying to display the Last Modified date of a document in Office documents using the Office Worker. The issue lies in the fact that the Last Modified attribute is of the Date & Time type, meaning it includes both the date and the precise time. However, I only need the date (yyyy-MM-dd format) in the Office document.
Here’s what I’ve tried so far:
Successfully Displayed Created On date
I managed to pass the Creation Date to Office Worker by creating a custom alias attribute that referenced the WTDocumentMaster Created On. I set this alias attribute to the Date only type, and it worked perfectly.Issues with the Last Modified Attribute
When attempting the same approach for the Last Modified attribute, I encountered several challenges:- The WTDocument and WTDocumentMaster have different Last Modified attributes, and I cannot directly reference the WTDocument Last Modified attribute with a custom alias because it already exists for that type.
- Changing the Last Modified attribute display format to yyyy-MM-dd on the Windchill UI did not solve the problem. (According to this topic: Custom Last modified attribute that shows only the date) Although the date appeared correctly in the UI, Office Worker still retrieved the full Date & Time value (including hours, minutes, and seconds) when adding it to the Office document. This behavior is expected since the underlying database format remained unchanged.
Attempted a Calculated String Attribute
I also tried creating a custom String-type calculated attribute that references the formatted Last Modified attribute (yyyy-MM-dd). Unfortunately, this approach didn’t work either. Both the calculated attribute and the formatted Last Modified attribute appeared in the yyyy-MM-dd HH:mm:ss <zone_id> format in the Office documents and also in the UI. When I removed the formula from the calculated attribute, the Last Modified attribute returned to customized display format (yyyy-MM-dd).This feels like a potential bug.
Do you have any ideas how could I display the Last Modified date in yyyy-MM-dd format in Office documents? Is it even possible without code customization? Any insights or suggestions would be greatly appreciated.
Thank you!
Richard

