cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Translate the entire conversation x

Last Modified date in yyyy-MM-dd format in Office documents

RL_9925624
10-Marble

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:

 

  1. 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.

  2. 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.
  3. 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

1 REPLY 1

Hi @RL_9925624 

Thank you for your question. 

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.
 

Also, feel free to add any additional information you think might be relevant. It sometimes helps to have screenshots to better understand what you are trying to do.

 

Best regards,


Catalina
PTC Community Moderator
PTC
Announcements

Top Tags