xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

StoD()

Converts a "yyyymmdd" formatted string to a Date value

Syntax

StoD( [<cDate>] ) --> dDate

Arguments

<cDate>
This is an optional character string holding 8 digits to convert to a Date value. The digits are interpreted as year, month and day ( "yyyymmdd" ).

Return

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

Description

StoD() converts a DtoS() string back to a Date value. This string contains date information which is independent from country specific Date format settings.

Info

See also:CtoD(), Date(), DtoC(), DtoS(), StoT()
Category: Conversion functions , Date and time
Source:rtl\dateshb.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays various results of StoD()

   PROCEDURE Main
      SET CENTURY ON

      ? StoD( "20060501" )  // result: 05/01/2006
      ? StoD( "19060521" )  // result: 05/21/1906
      ? StoD()              // result:   /  /
      ? StoD("")            // result:   /  /
      ? StoD( "ABCDEFG" )   // result:   /  /
   RETURN

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