TutTimeCvtNumToStr


Name

TutTimeCvtNumToStr — convert a numeric time value to a string

Synopsis

T_BOOL TutTimeCvtNumToStr(time_cvtr, time_num, time_str_return) 
T_TIME_CVT time_cvtr; 
T_REAL8 time_num; 
T_STR *time_str_return; 

Arguments

time_cvtr — time converter to use

time_num — numeric time value to be converted to a string

time_str_return — pointer to store converted time string into

Return Values

TRUE if time_num successfully converted, FALSE otherwise.

Diagnostics

None

Description

TutTimeCvtNumToStr calls the num_to_str function of a time converter to convert a time number to a string. It is normally never necessary to use TutTimeCvtNumToStr directly; use the convenience function TutTimeNumToStr instead.

Caution

The string pointed to by time_str_return is managed by the time converter and should not be modified or deallocated.

See Also

TutTimeCvtLookup, TutTimeCvtStrToNum, TutTimeNumToStr

Examples

This example looks up the time converter hms, gets the current wall clock time, and then converts the time to a string using the hms converter:

T_TIME_CVT time_cvtr; 
T_REAL8 wall_time; 
wall_time = TutGetWallTime(); 
TutOut("Raw wall clock time is %f.\n", wall_time); 
time_cvtr = TutTimeCvtLookup("hms"); 
if (time_cvtr != NULL) { 
  T_STR time_str; 
  if (TutTimeCvtNumToStr(time_cvtr, wall_time, &time_str)) { 
    TutOut("Formatted wall clock time is %s\n", time_str); 
  }  
}  

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com