Returns a Date value from a DateTime expression.
TTOD(tExpression) |
Parameters
- tExpression
- Specifies a date and time expression from which TTOD(В ) returns a Date value. tExpression must evaluate to a valid DateTime. If tExpression contains only a time, Visual FoxPro adds the default date of 12/30/1899 to tExpression and returns this default date.
Return Value
Date
Example
The following example creates a Datetime type variable named gtDtime. TYPE(В ) displays T, indicating the variable is a Datetime type. TTOD(В ) is used to convert the variable to a date type, and TYPE(В ) now displays D, indicating the variable is a date type after the conversion.
| В | Copy Code |
|---|---|
STORE DATETIME( ) TO gtDtime && Creates a Datetime type memory variable
CLEAR
? "gtDtime is type: "
?? TYPE('gtDtime') && Displays T, Datetime type value
gtDtime = TTOD(gtDtime) && Converts gtDtime to a date value
? "gtDtime is now type: "
?? TYPE('gtDtime') && Displays D, character type value | |
js editor
Web development