IsDate PowerScript function
Description
Tests whether a string value is a valid date.
Syntax
|
1 |
<span>IsDate</span> ( <span>datevalue</span> <span></span>) |
|
Argument |
Description |
|---|---|
|
datevalue |
A string whose value you want to test |
Return Values
Boolean. Returns true if datevalue is
a valid date and false if it is not. If datevalue is null, IsDate returns null.
Usage
You can use IsDate to test whether a user-entered
date is valid before you convert it to a date datatype. To convert
a value into a date value, use the Date function.
The year value must be in the range 01 to 9999.
Examples
This statement returns true:
|
1 |
<span>IsDate</span>("Jan 1, 05") |
This statement returns false:
|
1 |
<span>IsDate</span>("Jan 32, 2005") |
If the SingleLineEdit sle_Date_Of_Hire contains
7/1/99, these statements store 1999-07-01 in HireDate:
|
1 |
Date HireDate |
|
1 |
IF <span>IsDate</span>(sle_Date_Of_Hire.text) THEN |
|
1 |
HireDate = Date(sle_Date_Of_Hire.text) |
|
1 |
END IF |
See Also
-
IsDate method
for DataWindows in the DataWindow Reference or the online Help
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest