Date/character conversion functions
 
Function
Description
Custom or in VFP subset?
CTOD(CHAR_VALUE)
 
The character to date function converts a character value into a date value. The character representation is always in the format “MM/DD/YY”.
VFP subset
DTOC(DATE_VALUE)
DTOC(DATE_VALUE, 1)
The date to character function converts a date value into a character value. The format of the resulting character value is MM/DD/YY. If the optional second argument is used, the result is in the format CCYYMMDD. See also: DTOS()
VFP subset
DTOS(DATE_VALUE)
 
The date to string function converts a date value into a character value. The format of the resulting character value is CCYYMMDD.
VFP subset
STOD(CHAR_VALUE)
 
The string to date function converts a character value into a date value: The character representation is in the format “CCYYMMDD”.
VFP subset
 
Examples:
CTOD( "11/30/88" )
DTOC(DATE()) returns the character value 05/30/87 if the date is May 30, 1987.
DTOC(DATE(), 1) returns 19940731 if the date is July 31, 1994.
DTOS( DATE() ) returns the character value 19870530 if the date is May 30, 1987.
STOD( "19881130" )