Understanding Per Diem Calculations Across Time Zone
To perform calculations, our per diem module relies on two key factors: the per diem configuration (typically defined by country regulations or customized by the company) and the travel details entered by the user in Expensya (including departure/return locations, dates, times, trip steps, and the selected allowance).
Once the configuration is identified, we apply the rules defined within it: how a day is considered (whether as a calendar day or a 24-hour period), and which selection logic is followed when multiple locations are visited in a single day (e.g., first visited, last visited, location with the most time spent, or prioritizing the location abroad). Additionally, we take into account the package rules and the conditions for allowances.
When reviewing the travel information provided by the user, we may encounter multiple time zones within the same trip step.
Case Study:
Let’s take the following example:
- (01/09) New York UTC-4 6:00 AM
- (01/09) London UTC+1 6:00 PM
- (02/09) Dubai UTC+4 2:00 PM
- (03/09) New York UTC-4 8:00 AM
On September 1st, the user was in both New York and London, spending time in two different time zones.
Depending on the type of information required for the calculation, conversions may be necessary:
For time range conditions, no conversion is needed. For example, a rule might state: "Provide a reduced allowance if the user returns before 7 PM." In this case, we use the return time in the local time zone of the return location.
In the provided example, the user returns to New York at 8:00 AM, so a reduced allowance will be applied.
Essentially, time range conditions are always based on either the departure or return time, meaning no conversion is required.
However, for time spent conditions, we must determine when conversions are necessary.
The boundaries of the day are always independent of time zones, meaning no conversions are needed.
The time spent in a location is used to determine the location logic (for example, if the rule is: "Consider the location where the user spent the most time that day"). In this case, conversions are necessary to accurately calculate the actual time spent.
When performing these conversions, we adhere to some basic rules:
Time zone conversion rule number 1
When the employee provides information about his travel
- [Location A ] [Date of departure] [Time of departure]
- [Location B ] [Date of arrival] [Time of arrival]
- [Location C ] [Date of arrival] [Time of arrival]
- [Location A ] [Date of return] [Time of return]
To calculate the time spent in Location A, we need to convert the arrival time in Location B into the time zone of Location A.
To calculate the time spent in Location B, we must convert the arrival time in Location C into the time zone of Location B.
Similarly, to determine the time spent in Location C, we need to convert the return time from Location A into the time zone of Location C.
Time zone conversion rule number 2
In cases where an allowance is given based on the amount of time spent, it will be limited to the 24-hour allowance. Country regulations typically do not define allowances for periods exceeding 24 hours, so if the time spent exceeds 24 hours, it will be capped at the 24-hour allowance.
Time zone conversion rule number 3
If the conversion results in a duration exceeding 24 hours before the first day or after the last day, we should not add an additional day, as it should not affect the established boundaries of the day. These boundaries are governed by either the calendar day rule or the 24-hour rule. For example, if the traveler returns to the location on December 1st, they will receive their final allowance on that date.
Time zone conversion rule number 4
Additionally, an “in-between day” will always be regarded as 24 hours of absence. This means that even if the user spends less or more than 24 hours due to time zone conversions, the time spent on an in-between day is consistently considered to be 24 hours.
- Travel example
A > B > C >A
- Location A= Paris UTC +2
- Location B= Rio de Janeiro UTC -3
- Location C = Bangkok UTC+7
01/09 Paris UTC+2 6:00am
02/09 Rio UTC-3 10:00am
04/09 Bangkok UTC+7 01:00am
05/09 Paris UTC+2 10:00PM
- To calculate the time spent in each location each day, we need to define the following:
- The boundaries of the day: In the case of a calendar day, this will be from 12:00 AM to 11:59 PM.
- The locations visited that day.
- The time spent in each location: This will be based on the time zone conversions mentioned earlier.
For September 1st:
The boundaries of the day are set from 6:00 AM to 11:59 PM.
The only location visited that day is Paris.
The time spent does not require conversion, as the user spent time in only one time zone, totaling 18 hours in Paris.
For September 2nd:
The boundaries of the day are defined as 12:00 AM to 11:59 PM.
The locations visited that day include Paris and Rio.
To calculate the time spent, we need to convert the time to Paris's time zone (UTC+2). According to Time Zone Conversion Rule #1, 10:00 AM in UTC-3 is equivalent to 3:00 PM in UTC+2. We will then calculate the time spent in Rio without conversion.
Time spent in Paris is from 12:00 AM to 3:00 PM, totaling 15 hours.
Time spent in Rio is from 3:00 PM to 11:59 PM, totaling 14 hours.
Time zone conversion rule number 4 applies in this case: the time spent that day will be considered 24 hours, regardless of the actual time spent.
For September 3rd:
The boundaries of the day are defined as 12:00 AM to 11:59 PM. However, the next day begins in Bangkok (UTC+7) at 1:00 AM, meaning that September 3rd will effectively end at 3:00 PM Rio time.
Time zone conversion rule number 5
The following day features a new destination, and the arrival time at this destination, when converted to the time zone of the last visited location for the current day, occurs before the end of the day. Therefore, the arrival time at this new destination is considered the end of the day, and the last visited location for the current day should not be listed as the starting location with midnight as the time for the next day.
In this case, we will convert the day boundary time to calculate the duration. However, for a day that is “in-between” (neither a departure nor a return day), the day boundary time should always be from 12:00 AM to 11:59 PM when following a calendar day basis.
The only location visited that day is Rio.
The time spent in Rio, according to Time Zone Conversion Rules #1 and #4, is from 12:00 AM to 3:00 PM (which is 1:00 AM Bangkok time), totaling 15 hours.
Time Zone Conversion Rule #4 applies here: the time spent that day will be considered 24 hours, regardless of the actual time spent.
For September 4th:
The boundaries of the day are defined as 12:00 AM to 11:59 PM.
The only location visited that day is Bangkok (the time spent in Rio between 12:00 AM and 1:00 AM has already been accounted for in the previous day).
To calculate the time spent, we will only use Bangkok's time zone (UTC+7).
Time spent in Bangkok is from 1:00 AM to 11:59 PM, totaling 23 hours.
Time Zone Conversion Rule number 4 applies here: the time spent that day will be considered 24 hours, regardless of the actual time spent.
For September 5th:
The boundaries of the day are defined as 12:00 AM to 10:00 PM.
The locations visited that day are Bangkok and Paris.
To calculate the time spent, we need to convert the return time from Paris to Bangkok's time zone (UTC+7) according to Time Zone Conversion Rule number 1. Thus, 10:00 PM (UTC+2) converts to 3:00 AM the next day (UTC+7). Based on Time Zone Conversion Rules number 2 and number 3:
Time spent in Bangkok= from 00:00 to 23:59 UTC+7 (24h) (he factually spent more than 24h, but we cap it to not consider the 06/09 when he actually didn’t travel).