Click to Rate and Give Feedback
MSDN
MSDN Library
Visual FoxPro
Reference
Language Reference
Functions
 CTOD( ) Function
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual FoxPro 9.0 SP2
CTOD( ) Function

Converts a character expression to a date expression.

CTOD(cExpression)

Parameters

cExpression

Specifies a character expression.

Date data type. CTOD( ) returns a Date value.

NoteNote

CTOD() can create ambiguous Date values and generates a compilation error when SET STRICTDATE is set to 2. To create unambiguous Date values, use the DATE( ) function.

The following example uses CTOD( ) to convert Character data to a Date and then performs simple date related actions.

SET CENTURY ON               && Shows the century value.
cDate="01/01/2003"
?CTOD(cDate)               && Returns 01/01/2003 as Date.
?GOMONTH(CTOD(cDate),12)   && Returns 01/01/2004.
?CTOD(cDate)+100            && Returns 04/11/2003.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker