Official Content

Returns a date from three given numbers: year, month and day

Syntax

YMDtoD(Numeric-expression1, Numeric-expression2, Numeric-expression3)
 
Where:
Numeric-expression1
    Represents the year.

Numeric-expression2
    Represents the month.

Numeric-expression3
    Represents the day.
 

Type Returned:
Date

Scope

Objects: Procedure, Transaction, Web PanelWork Panel
Generators: .NET, Ruby (up to GeneXus X Evolution 3), Java, RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol

Description

Returns a date from three given numbers: year, month and day.

The year will be set according to the First year of 20th century property:
0 = YEAR ................... year 2000
0 < YEAR < YEAR-LIMIT ...... year in the 21st. century
YEAR-LIMIT≤ YEAR < 100 ..... year in the 20th. century
If the resulting date is not valid, a null date will be returned.

The date format returned depends on the selected language:
- English: "mm/dd/yy"
- Portuguese: "dd/mm/yy"
- Spanish: "dd/mm/yy"
- Italian: "dd/mm/yy"
 
Note: We suggest the use of this function instead of CtoD function. It does not vary with the language.

Samples

1. Using two digits for the year

&YY = 91
&MM = 10
&DD = 15
YMDTOD(&YY, &MM, &DD) 

Result: 10/15/91 if English is set as the default Language.

2. Using four digits for the year

&YY = 1999
&MM = 08
&DD = 15
YMDTOD(&YY, &MM, &DD) 

Result: 08/15/1999 if English is set as the default Language.

See Also






 




Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant