| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Converts numeric seconds into a time formatted character string.
TString( <nSeconds> ) --> cTimeString
The function returns a character string containing the number of seconds formatted as hh:mm:ss.
TString() is used to convert numeric seconds into a time formatted character string containing hours, minutes and seconds of a 24h clock. It is the reverse function of Secs().
| See also: | Days(), ElapTime(), Time(), Seconds(), Secs() |
| Category: | Date and time |
| Source: | rtl\samples.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example shows various possibilities of converting seconds
// and time strings.
PROCEDURE Main
LOCAL nSeconds := Seconds()
LOCAL cTime := Time()
? nSeconds // result: 57816.61
? TString( nSeconds ) // result: 16:03:36
? Secs( cTime ) // result: 57816
? TString( 0 ) // result: 00:00:00
? TString( 60 ) // result: 00:01:00
? TString( 3600 ) // result: 01:00:00
? TString( 86399 ) // result: 23:59:59
? TString( 86400 ) // result: 00:00:00
? TString( 86460 ) // result: 00:01:00
RETURN
http://www.xHarbour.com