TutTimeNumToStr convert a time number to string using the Time_Format option
time_num
numeric time value to be converted to a string
String representation of time_num
.
None
TutTimeNumToStr is a convenience function that converts a numeric time value to its string representation. TutTimeNumToStr uses the value of the option Time_Format to determine which time converter to use and then calls TutTimeCvtNumToStr with the appropriate converter. If TutTimeCvtNumToStr returns FALSE
, then TutTimeNumToStr returns the string "UNKNOWN"
.
The string returned by TutTimeNumToStr is managed by the time converter and should not be modified or deallocated. If a more permanent copy of the string is needed, use T_STRDUP or TutStrDup to make one.
TutTimeCvtNumToStr, TutTimeStrToNum
This example prints the string representation of the current SmartSockets data time and the current wall clock computer time:
TutOut("SmartSockets
time is %s.\n",
TutTimeNumToStr(TutGetCurrentTime()));
TutOut("Wall clock time is %s\n.",
TutTimeNumToStr(TutGetWallTime()));
Because the same string storage is reused by time converters, this does not work:
TutOut("SmartSockets
time is %s.\nWall clock time is %s\n",
TutTimeNumToStr(TutGetCurrentTime()),
TutTimeNumToStr(TutGetWallTime()));
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |