Developer Documentation Library > UNICOM Intelligence Function Library > Date and time functions > DateNow
 
DateNow
Returns the current local date in a particular time zone.
Syntax
DateNow([ <value> [, <ignore_daylight_saving>]])
Parameters
<value>
Type: None
(Optional.) Long or Text value specifying the local time zone to use.
<ignore_daylight_saving>
Type: Boolean
(Optional.) Whether to ignore adjustments for daylight-saving time. The default value is False.
(return)
Type: Date
The current local date in the time zone.
Notes
The return value is the current local date in the time zone, with the time of day set to 00:00:00.
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 cannot be found 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 date for the program’s time zone:
DateNow()
See also
DateAdd
Date and time functions