<< Click to Display Table of Contents >> Perform timezone operations |
Many business situations require date-time comparisons and calculations. This section provide some examples on how to perform timezones operations.
•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 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:
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.
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.
The expression would be as follows:
ConvertUserTimetoServerTime(int idUser, DateTime userTime);
Click OK to save the changes.
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.
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.
The expression would be as follows:
ConvertServerTimeToTimeZoneTime(string sTimeZoneName, DateTime serverTime);
Click OK to save the changes.
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.
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.
The expression would be as follows:
ConvertServerTimetoUserTime(int idUser, DateTime serverTime)
Click OK to save the changes.
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.
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.
The expression would be as follows:
ConvertTimeZoneTimeToServerTime(string sTimeZoneName, DateTime timeZoneTime);
Click OK to save the changes.
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.
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.
The expression would be as follows:
GetOffsetForLocation(int idLocation);
Click OK to save the changes.
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.
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.
The expression would be as follows:
GetOffsetForOrganization(int idOrg);
Click OK to save the changes.
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.
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.
The expression would be as follows:
GetOffsetForUser(int idUser);
Click OK to save the changes.
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.
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.
The expression would be as follows:
GetOffsetForWorkingTimeZone();
Click OK to save the changes.
Last Updated 5/21/2025 5:24:56 PM