# Clarification of Temporal Schedule behaviour while using ScheduleInterval

**URL:** <https://community.temporal.io/t/clarification-of-temporal-schedule-behaviour-while-using-scheduleinterval/14788>\
**Category:** Community Support\
**Created:** [October 23, 2024, 10:21pm UTC](https://community.temporal.io/t/clarification-of-temporal-schedule-behaviour-while-using-scheduleinterval/14788 "2024-10-23T22:21:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Paulo\_Roberto\_Maia\_S](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/paulo_roberto_maia_s/32/6181_2.png) [@Paulo\_Roberto\_Maia\_S](https://community.temporal.io/u/Paulo_Roberto_Maia_S)\
**Post date:** [October 23, 2024, 10:56pm UTC](https://community.temporal.io/t/clarification-of-temporal-schedule-behaviour-while-using-scheduleinterval/14788/2 "2024-10-23T22:56:58Z")

</div>

When I posted I got recommended this post here

> [@Scheduled Action Interval first run date calculation](https://community.temporal.io/t/scheduled-action-interval-first-run-date-calculation/13135/2):
>
> Hi @bobwere47 I think this issue answers both of your questions, Let me know if it helps, Antonio

The github discussion mentioned led to me finding that this seems to work in java. There were no `phase` parameter in java, but i implied it were the offset

```auto
var offset = getNextDate().toInstant().getEpochSecond()
          % (60L * 60L * 24L * 7L * recurrence.getInterval());
        scheduleSpec.setIntervals(List.of(new
            ScheduleIntervalSpec(Duration.ofDays(7L * recurrence.getInterval()),
            Duration.ofSeconds(offset))));

```

EDIT: Strangely when we start to get in the month range this formula seems not to work 100%. The original situal started to happen again.

---

_[View the full topic](https://community.temporal.io/t/clarification-of-temporal-schedule-behaviour-while-using-scheduleinterval/14788)._
