Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hello
I am preparing a template, in which i want to define a parameter for "Date" i.e 'Created Date" and "Modified Date"
The "Created date" will be unchanged even after n number of updates, so i used a parameter "&todays_date".
But problem comes for the "Modified Date", which needs to be updated for every revision of drawing updated,
So for that i used "PTC_WM_MODIFIED_ON" (a parameter already available by default in <Tools>-- <Parameters>
With this parameter i get Date and Time together, but i want date only.
Please see the attachment for clear understanding of my question.
Thank You
Regards
Sumeet
Use a relation with extract(PTC_WM_MODIFIED_ON,1,9) to get the date.
Create a relation like this:
SHORT_CREATED_ON = EXTRACT(PTC_WM_CREATED_ON,1,10)
SHORT_MODIFIED_ON = EXTRACT(PTC_WM_MODIFIED_ON,1,10)
In order to 'freeze' the Created date, you need some additional code.
/* INITIAL RELEASE PARAMETERS
/* SET INITIAL VALUES FOR DRAWING PARAMETERS FROM WINDCHILL
/* ONLY WHEN REV IS 0 <-Modify for your revision scheme
if PTC_WM_REVISION == "0"
INITIAL_CREATED_ON = SHORT_CREATED_ON
endif
You also do this same thing for Created_By
I presume that this parameter "PTC_WM_MODIFIED_ON" is and Windchill parameter as I can't get this to work in Creo Parametric.
Searching the forum's there still does not seem to be a simple solution for what must be a universal issue.
HI,
The following PTC Article will help and shows different options for formatting the date/time
https://www.ptc.com/en/support/article/CS49539?source=search
As an example Use the following in your config.pro - date_type_parameter_format %dd-%mm-%yyyy
Excerpt from PTC Article on options: -