xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

TString()

Converts numeric seconds into a time formatted character string.

Syntax

TString( <nSeconds> ) --> cTimeString

Arguments

<nSeconds>
This is a numeric value specifying the number of seconds elapsed since midnight. If <nSeconds> is larger than 86400, it is set back to 0.

Return

The function returns a character string containing the number of seconds formatted as hh:mm:ss.

Description

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().

Info

See also:Days(), ElapTime(), Time(), Seconds(), Secs()
Category: Date and time
Source:rtl\samples.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe