Perform timezone operations

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Business Rules > Business Rules examples > Date operations and timers >

Perform timezone operations

Overview

In many business scenarios, accurate date-time comparisons and calculations are essential—especially when working across multiple time zones. This section introduces key Bizagi functions that help you manage time zone operations effectively.

 

When using these functions, keep in mind that each user's time zone is determined by the hierarchy defined in your Bizagi project. For more details, refer to the Managing time zones documentation.

 

If you need to review or update time zones for multiple users simultaneously, consider grouping users by Location. This approach ensures that all users within a location inherit the same time zone, allowing for consistent and streamlined date-time calculations across your processes.

 

Convert user time to server time zone

Convert server time to a specified time zone

Convert server time to users time zone

Convert a specified time zone to server time

Get offset for specified location

Get offset for organization

Get offset for user

Get offset for working time zone

 

To illustrate how to perform date operations let's take the following example: A Office Supply Request Process manages the necessary activities to request and approve office supplies. When an employee creates a request, he/she must enter the Request date and the Quotation date of each quotation.

 

In this example, we will use date operations in order to:

Assigns today's date to the request date (RequestDate attribute).

Set the duration of Activities.

Verify that the Products receive date is greater than the Request date. If not, display a validation message.

 

The data model of the Process is as follows:

 

TimezoneOperations01

 

Convert user time to server timezone

Converts a date-time value that is relative to a user's time zone into the servers time zone.

To convert the Request Date attribute to the server time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

TimezoneOperations04

 

ConvertUserTimetoServerTime(int idUser, DateTime userTime);

 

Click OK to save the changes.

 

Convert server time to a specified time zone

Converts a date in server time (UTC+0) to the equivalent date in the specified time zone.

To convert the Request Date attribute to the specified time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

ConvertServerTimeToTimeZoneTime(string sTimeZoneName, DateTime serverTime);

 

TimezoneOperations05

 

Click OK to save the changes.

 

Convert a specified time zone to server time

Converts a date-time value from a specified time zone to server time (UTC+0).

To convert the Request Date attribute to the specified time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

ConvertServerTimetoUserTime(int idUser, DateTime serverTime);

 

TimezoneOperations06

 

Click OK to save the changes.

 

Convert a specified time zone to server time

Converts a date-time value from a specified time zone to server time (UTC+0).

To convert the Request Date attribute to the specified time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

ConvertTimeZoneTimeToServerTime(string sTimeZoneName, DateTime timeZoneTime);

 

TimezoneOperations11

 

Click OK to save the changes.

 

Get offset for specified location

Returns the difference in minutes between a location’s time zone and the server time (UTC+0).

To convert the Request Date attribute to the specified time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

GetOffsetForLocation(int idLocation);

 

TimezoneOperations07

 

Click OK to save the changes.

 

Get offset for organization

Returns the difference in minutes between an organization’s time zone and the server time (UTC+0).

To convert the Request Date attribute to the specified time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

GetOffsetForOrganization(int idOrg);

 

TimezoneOperations08

 

Click OK to save the changes.

 

Get offset for user

Returns the difference in minutes between a specific user's defined time zone and the server time (UTC+0).

To convert the Request Date attribute to the specified time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

GetOffsetForUser(int idUser);

 

TimezoneOperations09

 

Click OK to save the changes.

 

Get offset for working time zone

Returns the difference in minutes between the time zone defined in the WorkingTimeZone key and the server time (UTC+0).

To convert the Request Date attribute to the specified time zone, go to the fourth step of the Bizagi Process Wizard and select Activity Actions.

Click the Task in which this action will be performed and create an Expression.

 

TimezoneOperations02

 

Add an expression module and select the attribute to which today's date will be assigned.

Use the Data Model option to navigate the Data Model.

 

TimezoneOperations03

 

The expression would be as follows:

 

GetOffsetForWorkingTimeZone();

 

TimezoneOperations10

 

Click OK to save the changes.


Last Updated 7/2/2025 11:59:37 AM