Scripting > UNICOM Intelligence Function Library > Date and time functions > TimeNow
 
TimeNow
Returns the current local time in a particular time zone.
Syntax
TimeNow([ Val [, IgnoreDaylightSaving]])
Parameters
Val
Type: None
Optional. Long or Text value specifying local time zone to use.
IgnoreDaylightSaving
Type: Boolean
Optional. Whether to ignore adjustments for daylight-saving time. Default is False.
(return)
Type: Date
The current local time in the time zone.
Remarks
The return value is the current local time in the time zone, with the date set to 30 December 1899.
If Val is a Long value, it is the index value of a time zone defined in the registry on the server, or -1 to specify UTC time.
If Val is a Text value, it is the name of a time zone defined in the registry on the server, or “UTC” to specify UTC time.
If Val is omitted, NULL or empty, the time zone associated with the program in which the function is called is used. By default, the program's time zone is the local time zone of the server, but this can be changed by calling SetTimeZone.
If Val is any other type, an error occurs.
If the time zone specified by Val is not in the registry, an error occurs (thus this function can be used to determine whether a specific value represents a valid time zone).
Example
This example returns the current local time for the program's time zone:
TimeNow()
See also
DateAdd
Date and time functions