DtoC Function

Official Content
This documentation is valid for:

Returns the character string corresponding to a given date

Syntax

Dtoc(date-expression)

Type Returned:
Character C(8)

Where:
date-expression
Is the date to be converted.

Description

Returns the String associated with the specified Date. The string “ / / “ is returned if the argument is a null Date expression.

The returned string has 2 digits for the year; to get 4 digits TtoC function has to be used.

Example

We want to store a character string reading "Report date: 04/12/94" in the variable &String, where 04/12/94 is supposed to be the current date.

&string = concat(“Report date:”, dtoc(Today()), “ ”)

The result will be:
Report date: 04/12/94

Scope

Objects: Procedures, Transactions, Web Panels
Languages: .NET, Ruby (up to GeneXus X Evolution 3), Java, RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol

See Also