Pages: [1]
  Print  
Author Topic: [SOLVED] date  (Read 262 times)
katleenspriet
Newbie
*
Posts: 1


« on: January 13, 2014, 01:38:01 PM »

Hey,

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 ?
« Last Edit: January 14, 2014, 08:24:50 AM by katleenspriet » Logged
Marco Boeck
Administrator
Hero Member
*****
Posts: 995


WWW
« Reply #1 on: January 13, 2014, 04:45:39 PM »

Hi,

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

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.0.002">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <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"/>
      </operator>
      <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"/>
    </process>
  </operator>
</process>

Regards,
Marco
Logged

Pages: [1]
  Print  
 
Jump to: