Please point me to a routine to convert the current time to a string like the date.a_toString( TodaysDate ) does for the date. Thanks.
Posted on 2005-06-10 11:08:44 by V Coder
VarBstrFromDate
Posted on 2005-06-10 15:30:53 by Biterider
Hi V Coder,

try GetTimeFormat
Posted on 2005-06-16 17:20:03 by arlequin

Please point me to a routine to convert the current time to a string like the date.a_toString( TodaysDate ) does for the date. Thanks.


There is no HLA Standard Library routine for this because it is fairly easy to do yourself.  Note the definition of a time value:
timerec:
record;

secs:uns8;
mins:uns8;
hours:uns16;

endrecord;


So if you get the current time into a "curTime" variable, you could print it thusly:

stdout.puti16( curTime.hours, 2, '0' );
stdout.putc( ':' );
stdout.puti8( curTime.mins, 2, '0' );
stdout.putc( ':' );

To create a string rather than output it, just use the appropriate "conv.*" routines to do the same job and then concatenate the result.
Cheers,
Randy Hyde

stdout.puti8( curTime.secs, 2, '0' );
Posted on 2005-07-10 21:51:06 by rhyde
In case anyone's interested, this procedure returns **Time on **Date, eg. "13:07:27 on Dec 5, 2005" in string s. The calling procedure needs to strfree(s);

   procedure Date_Time;
   begin Date_Time;
stralloc(80);
mov(eax, s);

   //TIME
stralloc(10);
mov(eax, s1);
time.curTime(t);
conv.u16ToStr(t.hours, 2, '0', s1);
str.cat(s1, s);
str.cat(":",s);
conv.u8ToStr(t.mins, 2, '0', s1);
str.cat(s1, s);
str.cat(":",s);
conv.u8ToStr(t.secs, 2, '0', s1);
str.cat(s1, s);
strfree(s1);

str.cat(" on ", s);
   //DATE
date.today( TodaysDate );
date.setFormat( date.MONdyyyy );
date.a_toString( TodaysDate );
mov(eax, s1 );
str.cat(s1, s);
strfree(s1);
   end Date_Time;
Posted on 2006-01-07 18:38:38 by V Coder