Page 1 of 1

yyyymmdd to timestamp

Posted: Mon Mar 23, 2015 2:37 am
by Gius
hello,
I have two variables
var1 is the Date : YYYYMMDD
var2 is the time : HHMMSSTH

and I would like to concatenate those two variable in one, with the timestamp format ?

Thank you for your help

Re: yyyymmdd to timestamp

Posted: Mon Mar 23, 2015 3:28 am
by Gius
I tried this but it give me an error

StringToTimestamp(%DSLink8.PutDate:Left(DSLink8.PutTime,8)
%,[%"%yyyy%mm%dd %hh%nn%ss"%])

Re: yyyymmdd to timestamp

Posted: Mon Mar 23, 2015 4:30 am
by Gius
I'm still trying things,

StringToTimestamp( "2015-01-01 11:11:11" ,'%YYYY-%MM-%DD %hh:%nn:%ss')

But this simple expresion give me an error

Transformer_6,1: 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.

Posted: Mon Mar 23, 2015 4:45 am
by vinothkumar
Try with this, which is having all in lower case.
StringToTimestamp("2015-01-01 11:11:11",'%yyyy-%mm-%dd %hh:%nn:%ss')

Posted: Mon Mar 23, 2015 10:49 pm
by vinothkumar
It is marked as RESOLVED. Post your resolution please.

Posted: Mon Mar 23, 2015 11:29 pm
by chulett
I marked it as resolved because of the rating on your previous post: "Solved my problem!". Hover your mouse over it.

Posted: Tue Mar 24, 2015 12:22 am
by vinothkumar
oops.. my bad. Sorry craig. I did not notice that.