Stores Date values.
Generators: .NET, .NET Framework, Java, Apple, Android
The following table illustrates the conversion GeneXus performs according to the DBMS:
DBMS |
Conversion |
Oracle |
DATE |
DB2 Universal Database |
DATE |
Informix |
DATE |
SQL Server |
DATETIME |
Access |
DBDate |
DB2 for iSeries |
CHAR(8) or DATE1 |
DBF |
DATE(8,0) |
PostgreSQL |
DATE |
1 Depends on the value set for the Date data type definition property.
Read about Pictures that can be applied to Date data types.
Static methods
The Date data type has two static method available only for the .NET, .NET Framework and Java generators.
Generates Date instances with specific values for the date.
Date.New(Year,Month,Day)
&ExpirationDate = Date.New(2018,6,10)
If &ExpirationDate >= Date.New(2022,1,4)
msg("The date has expired")
EndIf
Today
Gets the current system date.
Date.Today()
&date = Date.Today();
&dateString = &date.ToString()
msg(&dateString) // 09/12/23
When generating iOS code, controls based on the Date / DateTime data type, use the Date format property and Hour format property to infer the native styles dateStyle and timeStyle which take into account the user's preferences in the device settings.
DateTime data type
Data types list