Skip to main content
1-Visitor
Apr 24, 2018 6:39 PM UTC
Question

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

    TomU
    23-Emerald IV
    Apr 24, 2018 6:49 PM UTC

    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

    Translate
    23-Emerald III
    Apr 24, 2018 6:56 PM UTC

    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.

    Translate
    1-Visitor
    Apr 24, 2018 7:25 PM UTC

    Not from windchill

    Translate
    23-Emerald III
    Apr 24, 2018 8:09 PM UTC

    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.

    Translate