Page 1 of 1

string to timestamp

Posted: Wed May 12, 2010 12:50 am
by pavankatra
hi,
my input column:doc_guid
datatype :varchar
I want to insert this value into target
StringToTimestamp(lk_read.sheet,"yyyy-mm-dd hh:nn:ss")

i want to implement this in transformer.

I am getting below error
APT_CombinedOperatorController,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "yyyy-%mm-%dd hh:nn:ss" for conversion "timestamp=timestamp_from_ustring[%yyyy-%mm-%dd %hh:%nn:%ss](ustring)": APT_Conversion_String_TimeStamp: Invalid format [yyyy-%mm-%dd hh:nn:ss] used for string_from_time type conversion.
So can anyone please help me on this

Thanks in advace

Posted: Wed May 12, 2010 3:05 am
by Sainath.Srinivasan
The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss

Posted: Wed May 12, 2010 3:05 am
by Sainath.Srinivasan
The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss

Posted: Wed May 12, 2010 3:05 am
by Sainath.Srinivasan
The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss

Posted: Wed May 12, 2010 3:51 am
by Etler21
try this way -

StringToTimestamp((lk_read.sheet[1,4]:'-':lk_read.sheet[5,2]:'-':lk_read.sheet[7,2]) : "-" : "00" :"." : "00" :"." : "00" )

Posted: Wed May 12, 2010 3:57 am
by pavankatra
Sainath.Srinivasan wrote:The format must be

Code: Select all

%yyyy-%mm-%dd %hh:%nn:%ss
thanks for your reply
i have given like this
StringToTimestamp(lk_read.sheet,"yyyy-mm-dd hh:nn:ss")
i was tried with this %yyyy-%mm-%dd %hh:%nn:%ss,but its not accepting.so please sugget me how to do this

thanks in advance for your help.

Posted: Wed May 12, 2010 5:11 am
by Sainath.Srinivasan
What do you mean by 'not accepting' ?

Post the exact derivation and the corresponding warning / error.

Posted: Wed May 12, 2010 6:52 am
by chulett
Also let us know what the "target" is.