xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

StoT()

Converts a "YYYYMMDDhhmmss.ccc" formatted string to a DateTime value

Syntax

StoT( [<cDateTime>] ) --> dDateTime

Arguments

<cDateTime>
This is an optional character string holding up to 18 digits (and period) to convert to a DateTime value. The digits are interpreted as year, month and day ("YYYYMMDD") and Hour, Minute Seconds and Milliseconds ("hhmmss.ccc").

Return

The function returns the converted character string as a DateTime value. If no parameter is passed, or if <cDateTime> is not a valud DateTime string (""), an empty DateTime value is returned.

Description

StoT() converts a TtoS() string back to a DateTime value. This string contains date and time information which is independent from country specific Date format settings.

Info

See also:Date(), DateTime(), StoD(), TtoC(), TtoS()
Category: Conversion functions , Date and time , xHarbour extensions
Source:rtl\dateshb.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays various results of StoT()

   PROCEDURE Main
      SET CENTURY ON

      ? StoT( "20070426" )           // result: 04/26/2007
      ? StoT( "20070426133045" )     // result: 04/26/2007 13:30:45.00
      ? StoT( "20070426133045.67" )  // result: 04/26/2007 13:30:45.67
      ? StoD()                       // result:   /  /
      ? StoD( "ABCDEFG" )            // result:   /  /
   RETURN

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