PDM, Where to set the format for %date% save in text variable?

Installation, PDM, standards, training, support, part numbering, rev schemes, etc.
User avatar
bnemec
Posts: 1851
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2436
x 1330

PDM, Where to set the format for %date% save in text variable?

Unread post by bnemec »

This is probably a dumb question, but how do I define the date format when setting a variable value to %date% in a transition action?

I've been told that the date format on our rev table it not ideal. I cannot find where to change it. The rev table is populated from PDM work flow transition. The variable is set to data type = text so that tells me the format is defined when the date is converted to text clear back when the variable is set in the transition actions.

image.png
Thank you.
by jcapriotti » Fri Apr 02, 2021 5:15 pm
Each vault has a date format, right click the vault name in the administration tool and select "Properties"
image.png
Go to full post
User avatar
jcapriotti
Posts: 1792
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1132
x 1940

Re: PDM, Where to set the format for %date% save in text variable?

Unread post by jcapriotti »

Each vault has a date format, right click the vault name in the administration tool and select "Properties"
image.png
Jason
User avatar
bnemec
Posts: 1851
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2436
x 1330

Re: PDM, Where to set the format for %date% save in text variable?

Unread post by bnemec »

So there's only >one< place to set it?

That will be system wide there are other places where we sort by date and I fear it is text data type so it will sort for crap if I put it to what they're asking for MM-dd-yy. That's why I default my dates to yyyy-MM-dd when converting to text, so they sort!

In rev table there's no need to sort so it doesn't matter really, but if it's system wide... ugh.
User avatar
jcapriotti
Posts: 1792
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1132
x 1940

Re: PDM, Where to set the format for %date% save in text variable?

Unread post by jcapriotti »

Well, I would think this would be universal for your company and you would want it the same everywhere but I get the need to have year first for sorting. Unfortunately I don't believe you can control it via the built in functions, it defaults to the vault format.

One potential solution is Dispatch. You can get date and time then format how you like and apply to a variable during a transition.
image.png
image.png
image.png
Jason
User avatar
bnemec
Posts: 1851
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2436
x 1330

Re: PDM, Where to set the format for %date% save in text variable?

Unread post by bnemec »

jcapriotti wrote: Fri Apr 02, 2021 6:03 pm Well, I would think this would be universal for your company and you would want it the same everywhere but I get the need to have year first for sorting. Unfortunately I don't believe you can control it via the built in functions, it defaults to the vault format.

One potential solution is Dispatch. You can get date and time then format how you like and apply to a variable during a transition.

image.png

image.png

image.png
Thank you Jason. I'm going to see if what all is affected by that format, maybe I can just change it and be ok. It will be a mixed bag then as what's in the data card variables now won't change I assume.
It's not that it would be different for different people, for example the variable is used on the revision table, but also as a column in the Contains and where used tabs for example (those just come to mind now) it's probable to sort by the revised date in that context, but not in the revision notes table on the drawing. I'm wondering now why a variable for storing a date was set up as Text instead of Date type.
I'm used to the year-month-date standard so I didn't see the problem I guess others think the month must be first...
User avatar
jcapriotti
Posts: 1792
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1132
x 1940

Re: PDM, Where to set the format for %date% save in text variable?

Unread post by jcapriotti »

I would consult with your VAR on changing the format on an existing production vault, I've never done it. I'm assuming it just means dates are stored in the new format for new data only. Which may or may not cause an issue for you.....mostly when sorting dates and it's mixed. Some of the date searches where you use < some date might not work as expected.
Jason
User avatar
AlexB
Posts: 434
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 22
x 242
x 383

Re: PDM, Where to set the format for %date% save in text variable?

Unread post by AlexB »

jcapriotti wrote: Fri Apr 02, 2021 6:45 pm I would consult with your VAR on changing the format on an existing production vault, I've never done it. I'm assuming it just means dates are stored in the new format for new data only. Which may or may not cause an issue for you.....mostly when sorting dates and it's mixed. Some of the date searches where you use < some date might not work as expected.
To build on this, I will add that I've run into some issues with date formats and which interface of PDM sets the value (Client or Server). If the client has changed their date format to something other than the server, then I've seen their system format come through in custom property settings for the file. The server can still set default values according to it's date format, however I don't believe it will over-write or re-format the variables coming from the client side.
User avatar
bnemec
Posts: 1851
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2436
x 1330

Re: PDM, Where to set the format for %date% save in text variable?

Unread post by bnemec »

AlexB wrote: Fri May 07, 2021 9:54 am To build on this, I will add that I've run into some issues with date formats and which interface of PDM sets the value (Client or Server). If the client has changed their date format to something other than the server, then I've seen their system format come through in custom property settings for the file. The server can still set default values according to it's date format, however I don't believe it will over-write or re-format the variables coming from the client side.
I don't think we'll be changing this. The more I dug into it the worse it looked to change the date. Just for clarity, we didn't want to change the format for different users. Rather, we would like to apply a format when the current date (%date%) is applied to a data card variable, so that the revised and approved dates in the drawing revision table would show up a certain way. When the vault was set up I did not realize that the system date format was for the entire system with no exceptions, and that changing it after going live could possibly cause big problems.
Post Reply