yogesh kapil
19th May 2012, 07:14
hi,

can sombody help me :- i am using date with datatype UTC date/time. please see below code

string dt(8)
dt = num.to.date$(dayno, 2)
message("after dayno=%d", dt)

i am getting empty string in dt . please tell me why num.to.date$ not working.
or should i use other fuction.


waiting for your positive response.

gjeyapra
21st May 2012, 09:23
hi,

can sombody help me :- i am using date with datatype UTC date/time. please see below code

string dt(8)
dt = num.to.date$(dayno, 2)
message("after dayno=%d", dt)

i am getting empty string in dt . please tell me why num.to.date$ not working.
or should i use other fuction.


waiting for your positive response.


Hi,
Variable 'dt' is declared as string, while within the message it has been quoted as '%d'. Change it to '%s' and try. Function num.to.date$ returns formatted string.

message("after dayno=%s", dt)

-GM

bdittmar
21st May 2012, 13:28
hi,

can sombody help me :- i am using date with datatype UTC date/time. please see below code

string dt(8)
dt = num.to.date$(dayno, 2)
message("after dayno=%d", dt)

i am getting empty string in dt . please tell me why num.to.date$ not working.
or should i use other fuction.


waiting for your positive response.

Hello,

use the proper forum in future, please.
This forum only is for SOURCES !

Maybe a moderator moves this thread.

Regards

mark_h
21st May 2012, 15:01
Thread moved as requested. This is the correct forum for tools and development type questions.

BaanInOhio
22nd May 2012, 19:05
You can't use the 'date' functions with UTC dates/times. They are reserved for the date numbers that do not include time (domain tfgld.date). Since you have times and timezones involved with UTC dates, the functions to use for conversions are different and more robust. See help for more info. If you want to simply print a date based on a UTC number, use "utc.to.inputstr$()":

string dt(12), tm(12)
long ret

| Use can use your favorite date/time formats in the 2nd and 3rd arguments.
ret = utc.to.inputstr(dayno, "%u001", %U001", dt, tm)
message("after dayno=$1%s", dt)