Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>ctod()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CTOD()

Syntax:     CTOD(<expC>)

Purpose:    To convert a date string to a date value.

Argument:   <expC> is a character string consisting of numbers
            representing the month, day, and year separated by a
            delimiter character (any character other than a number).
            When you pass the date string, CTOD() evaluates the order of
            the month, day, and year substrings according to the DATE
            SETting.  The default is AMERICAN ("mm/dd/yy").

            Century: The twentieth century is the default if only
            two digits are specified for the year.

            Empty date: To specify a null date, use SPACE(8), "",
            or  "  /  /  " as the function argument.

Returns:    A date value.

Usage:      CTOD() is useful whenever you want to use a character string
            as a date value.  There are a number of common instances
            which include:

            .  Initializing a memory variable as a date.

            .  Specifying a literal date string as an argument of a
               RANGE clause of @...GET.

            .  Specifying a literal date string in order to perform date
               arithmetic.

            .  Comparing the result of a date expression to a literal
               date string.

            .  REPLACEing a date field with a literal date string.


Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   charvar  = "09/01/87"
   ? TYPE("charvar")                && Result: C
   saledate = CTOD(charvar)
   ? TYPE("saledate")               && Result: D

   SET DATE ANSI
   ? CTOD("12.12.12")               && Result: 12.12.12
   ? CTOD("12 12 12")               && Result: 12.12.12

   ? CTOD(SPACE(8))                 && Result:   /  /
   ? CTOD("")                       && Result:   /  /


See Also: SET DATE DTOC() DTOS()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson