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

ToClientTime

Converts a DateTime value from UTC time to the local time of the logged-in user. If you execute this function without the optional time parameter, returns the current local time associated with the current session.

Syntax

ToClientTime(time)

Enabled for

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

Parameters

time

(Optional) A UTC time to convert to local time. The default is the current time.

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

$(ToClientTime(CurrentDateTime()))

The above example returns the current local time.

 

$(ToClientTime(HOPCalcTargetDate("Weekly HOP", CurrentDateTime(), ((12 * 60) * 60))))

If $(HOPCalcTargetDate("Weekly HOP", CurrentDateTime(), ((12 * 60) * 60))) returns 10/15/2014 8:22:03 PM and your time zone is UTC-7, this returns 10/15/2014 1:22:03 PM.