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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Getting date from datetime format

NaveenGourav
7-Bedrock

Getting date from datetime format

I have a table with a column with datetime format .I need to create another column which will contain only date.

Can any one help on this.

4 REPLIES 4
TomU
23-Emerald IV
(To:NaveenGourav)

Not sure what product you are using, but this area is for the eSupport tools on PTC.com.  Things like the knowledge base, case creator, etc.  You will probably have better luck posting your question in the appropriate product area.

 

PTC Community Product Areas.PNG

Where is the datetime coming from?

 

If from a Windchill parameter, use an extract statement in relations to get the date only portion.

date_only = extract(ptc_wm_created_on,1,10)

This will pull the 10 characters of the date (2018-04-24) from the parameter ptc_wm_created_on. You may use  ptc_wm_modified_on depending on your needs.

Not from windchill

Where is the datetime coming from?

 

In order to be in a table in Creo, it has to be in Creo as a parameter. Use the same extract code, but use your parameter instead of the Windchill one in my example. IF the date is not the first 10 charcaters, adjust the start position (1) and the end position (10) for your string. You can get fancy with relations and totally format any way you want by extracting the various segments.

Announcements


Top Tags