[SOLVED] date

katleensprietkatleenspriet Member Posts: 1 Contributor I
edited November 2018 in Help

I have a date in my excel file as follows 20130510 as being May 10, 2013. I read it in as a numerical value and I want to convert it to a date. I used the generate attributes to first convert it to a text and then to a date as follows date_parse_custom(str(production_date),"yyyyMMdd","en"). The problem is that this gives me a datetime with the timestamp set at 12:00:00 AM CEST.

How do I get only a date ?


  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering

    have a look at the "Nominal to Date" operator.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.0.002">
      <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="nominal_to_date" compatibility="6.0.002" expanded="true" height="76" name="Nominal to Date" width="90" x="246" y="30">
            <parameter key="attribute_name" value="Test"/>
            <parameter key="date_format" value="yyyyMMdd"/>
          <connect from_op="Nominal to Date" from_port="example set output" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
Sign In or Register to comment.