Reference > Expressions > Built-in Functions > Date Functions > CurrentDateTime

CurrentDateTime

Returns the local date and time of today, as a DateTime value, of the current session. Use this function to populate a field with today's date and time.

  • This function returns the local date and local time for today as a DateTime value.
  • The CurrentDate function returns midnight UTC time on the server and midnight local time on the client as a DateTime value.

Syntax

CurrentDateTime()

Enabled for

Search/Dashboard Yes
Business Rules Yes
Quick Actions Yes
Workflow Objects Yes
Reports No

Parameters

none

 

Return Value

DateTime value.

If the system has to display the return value, it implicitly converts it to text, thereby allowing the display format to change depending on your culture code. See Available Languages and Cultures for a list of the culture codes used by HEAT.

Example

$(CurrentDateTime())

If the current date is January 15, 2014 at 4:30 PM and your time zone is Pacific time (which is UTC-7 during daylight savings time but UTC-8 during standard time), this function returns January 16, 2014 at 12:30 AM on the server and local time of January 15, 2014 at 12:30 AM on the client.

 

$(DateAdd("day",-90,CurrentDateTime()))

The example above shows how to retrieve instances from the past 90 days in conjunction with the DateAdd() function.

Searching for instances created after a specific date does not work as expected. For example, if you search for instances created after 12/12/2012 (December 12, 2012), the system returns a list of instances created throughout 2012 (before the date you want).

To obtain the result you want, use the CurrentDateTime() function with the DateAdd() function as shown in the following example:

CurrentDateTime() Example