4D v12.4Date |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v12.4
Date
|
Date ( dateString ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
dateString | String |
![]() |
String representing the date to be returned | |||||
Function result | Date |
![]() |
Date | |||||
The Date command evaluates dateString and returns a date.
The dateString parameter format must follow the regional settings defined at the System level. For example, in the US version of 4D, by default the date must be in the order MM/DD/YY (month, day, year). The month and day can be one or two digits. The year can be two or four digits. If the year is two digits, then Date considers whether the date belongs to the 21st or 20th century according to the value entered. By default, the pivotal value is 30:
Date does not check whether or not dateString is a valid date. If an invalid date (such as "13/35/94") is passed, Date will return the invalid date. However, if dateString could not possibly be interpreted as a date (for example, "aa/12/94"), the null date value (!00/00/00!) is returned.
It is your responsibility to verify that dateString is a valid date.
The following example uses a request box to prompt the user for a date. The string entered by the user is converted to a date and stored in the reqDate variable:
vdRequestedDate:=Date(Request("Please enter the date:";String(Current date)))
If(OK=1)
` Do something with the date now stored in vdRequestedDate
End if
The following example returns the string "12/25/94" as a date:
vdDate:=Date("12/25/94")
Product: 4D
Theme: Date and Time
Number:
102
Created: < 4D v6