Siebel VB Language Reference > VB Language Reference >
Now Function
This standard VB function returns the current date and time. Syntax
Now()
Returns
The current date and time as indicated by the clock of the server that is executing the code. Usage
The Now function returns a variant of vartype 7 (date) that represents the current date and time according to the setting of the computer's date and time. Use the Format function to specify the format in which the date and time should appear. Example
This example finds the month (1-12) and day (1-31) values for this Thursday. For another example, read Format Function. Sub Button_Click Dim x As Integer, today As Variant Dim msgtext As String Today = DateValue(Now) Let x = 0 Do While Weekday(Today + x) <> 5 x = x + 1 Loop msgtext = "This Thursday is: " & Month(Today + x) & "/" & _ Day(Today + x) End Sub
Related Topics
Date Function Date Statement Day Function Hour Function Minute Function Second Function Time Function Time Statement WebApplet_InvokeMethod Event Year Function
|