Siebel VB Language Reference > Methods Reference for Siebel VB > Date and Time Methods >

Set Date Method


The Set Date method sets the computer date. It does not return a value. Note the following:

  • If you do not include the dollar sign ($), then the expression can be a string that contains a valid date, a date variable type, or a string variable type. For more information, see Variants.
  • If the expression argument is not already a date variable type, then it attempts to convert this value to a valid date from January 1, 1980, through December 31, 2099.
  • To identify the day, month, and year if a string contains three numbers that are separated by valid date separators, it uses the Short Date format in the International section of Microsoft Windows Control Panel. It recognizes month names in full or abbreviated form.
Format

Date[$] = expression

The following table describes the arguments that you can use with this method.

Argument
Description

expression

A string in one of the following forms:

  • mm-dd-yy
  • mm-dd-yyyy
  • mm/dd/yy
  • mm/dd/yyyy

The following table describes the value you must specify for each item in the expression.

Value
Value You Must Specify

mm

A month expressed as a two-digit number in the range of 01 through 12.

dd

A day expressed as a two-digit number in the range of 01 through 31.

yy

A year expressed as a two-digit number in the range of 00 through 99.

yyyy

A year expressed as a four-digit number in the range of 1980 through 2099.

Example

The following example modifies the computer date to a date that the user enters:

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 Sub

Siebel VB Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.