Noor Jahan
7th February 2016, 19:57
Hi all

Iam converting a string to date

As
Hold.date containes string "2/4/2014"and hold.time contains string "4:5:16"


Iam usinh inputstr.to.utc funtion for cinverting this to utc format

Inputstr.to.utc(hold.str,%D(%M/%D/%Y),hold.time,%U(%m:%h:%s)
But its returning value -1


Please help

bhushanchanda
8th February 2016, 12:27
Hi,

To use inputstr.to.utc() you need to have the Date & Time formats defined in your Data Dictionart (Tools)

Instead, you can try this -

string date.s(100)
string time.s(100)
domain tcdate date.new

long mm,dd,yyyy
long mins,sec,hr

date.s = "13/02/2015"
time.s = "06:24:53"

string.scan(date.s,"%d/%d/%d",dd,mm,yyyy)
string.scan(time.s,"%d:%d:%d",hr,mins,sec)

date.new = date.to.utc(yyyy,mm,dd,hr,mins,sec)

Ajesh
9th February 2016, 09:48
Hi all

Iam converting a string to date

As
Hold.date containes string "2/4/2014"and hold.time contains string "4:5:16"


Iam usinh inputstr.to.utc funtion for cinverting this to utc format

Inputstr.to.utc(hold.str,%D(%M/%D/%Y),hold.time,%U(%m:%h:%s)
But its returning value -1


Please help

You had mentioned you used hold.date but in the function you used hold.str. Not sure though, but this typo from you might be the reason.