Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
Date Statement
This standard VB function sets the computer's date.
Syntax
Date[$] = expression
In the preceding string forms, the placeholders are interpreted as follows:
Returns
Not applicable
Usage
If the dollar sign ($) is omitted, expression can be a string containing a valid date, a variant of vartype 7 (date), or a variant of vartype 8 (string).
If expression is not already a variant of vartype 7 (date), Date attempts to convert it to a valid date from January 1, 1980, through December 31, 2099. Date uses the Short Date format in the International section of Windows Control Panel to recognize day, month, and year if a string contains three numbers delimited by valid date separators. In addition, Date recognizes month names in either full or abbreviated form.
Example
This example changes the computer's date to a date entered by the user.
Sub Button_Click
Dim userdate
Dim answer
i:
userdate = "2/5/2001"
If userdate = "" then
Exit Sub
End If
answer = IsDate(userdate)
If answer = -1 then
Date = userdate
Else
Goto i
End If
End SubSee Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |