Skip to main content
Hi,

 

 

I have a column named DateTime in a table. The format of date and time is as follows:

 

 

9/9/2009 21:23:31

 

25/12/1991 8:3:23

 

 

means There is a space b/w date and time. Date Month Year is seperated by '/' and time by ':'

 

Now, I need to seperate date and time. I want two new attributes Date and Time with respected outputs. Thanks in advance.

 

 
Hi, I would use the AttributeSplitter with setting Delimiter to a whitespace.

 

Takashi
Hi,

 

I would use the AttributeSplitter (set on ' ' space]) and remap the list elements into your output attributes.

 

Itay

 

 
Thanks for the reply.

 

@Takashi: I tried setting Delimiter to a whitespace, but there is no change in the output while doing that.

 

@Itay: I am not aware of remapping the list elements.
The AttributeSplitter will not change the original attribute, split result will be stored in a list attribute.

 

e.g.

 

_list{0} = '9/9/2009'

 

_list{1} = '21:23:31'

 

 

You can then rename them with the AttributeRenamer, if necessary.

 

_list{0} => Date

 

_list{1} => Time
exactly what Takashi means....
The AttributeSplitter will not change the original attribute, split result will be stored in a list attribute.

 

e.g.

 

_list{0} = '9/9/2009'

 

_list{1} = '21:23:31'

 

 

You can then rename them with the AttributeRenamer, if necessary.

 

_list{0} => Date

 

_list{1} => Time

How to split datetime column if there is no whitespace or delimiter character available. for example how to split "19960108031100" into date and time?


How to split datetime column if there is no whitespace or delimiter character available. for example how to split "19960108031100" into date and time?

Hi! If the length don't change, you can use Attribute manager. You create 2 new attribute with string formula. With left or rigth function you can extract the values. Then remove the original attribute if you want.


Reply