Architect DateTimeDiff returning incorrect results with PST offsets

I have been trying to build a specific logic flow in Genesys Cloud Architect to calculate the number of business days between two timestamps. The requirement is strict. We need to count only weekdays, excluding weekends. I am using the DateTimeDiff function in an expression.

The setup seems straightforward on paper. I have two date variables, StartDate and EndDate. I want to subtract the Start from the End and filter out Saturdays and Sundays. Here is the expression I am currently testing in the Data Action.

DateTimeDiff(StartDate, EndDate, "d")

The problem is the timezone handling. The system is in US/Pacific, but the DateTimeDiff function seems to be calculating based on UTC internally or something similar. When I test with a date range that crosses a weekend boundary, the result is off by one day. For example, if I start on Friday and end on Monday, it returns 4 days instead of 3 (assuming we only want weekdays). I tried using GetDayOfWeek to manually filter, but the syntax for combining these in a single expression is proving difficult.

Is there a way to force DateTimeDiff to respect the local agent timezone before doing the subtraction? I cannot find a clear example in the documentation for combining DateTimeDiff with GetDayOfWeek to exclude weekends. The expression parser is very strict about the format.

I also tried this approach.

If(GetDayOfWeek(StartDate) = 7, 1, 0) + If(GetDayOfWeek(EndDate) = 1, 1, 0)

But this just tells me if the start or end is a weekend. It does not help me calculate the total difference while skipping the middle weekend days. I am stuck on the logic to iterate or filter the days in between. Any ideas on the correct expression syntax for this scenario?