Get 30 minute time slots in between two times

So i want to get 30 minute time slots between two times. I have a start_time that looks like this:

{
  "date": {
    "day": 22,
    "month": 8,
    "year": 2022
  },
  "time": {
    "hour": 9,
    "minute": 0,
    "second": 0,
    "millisecond": 0
  },
  "timeZone": "America/Los_Angeles"
}

and an end_time like this:

{
  "date": {
    "day": 22,
    "month": 8,
    "year": 2022
  },
  "time": {
    "hour": 10,
    "minute": 30,
    "second": 0,
    "millisecond": 0
  },
  "timeZone": "UTC"
}

How do i create 30 minute time slots in between of those formatted as dateTime objects? Essentialy i’d like my output to be something like:

[
{
  "date": {...},
  "time": {
    "hour": 9,
    "minute": 0,
    "second": 0,
    "millisecond": 0
  },
  "timeZone": "America/Los_Angeles"
},{
  "date": {...},
  "time": {
    "hour": 9,
    "minute": 30,
    "second": 0,
    "millisecond": 0
  },
  "timeZone": "America/Los_Angeles"
}
,{
  "date": {...},
  "time": {
    "hour": 10,
    "minute": 0,
    "second": 0,
    "millisecond": 0
  },
  "timeZone": "America/Los_Angeles"
}
]

Nevermind, figured this one out!

FROM
  offset
IN
  RANGE(
    0,
    DATETIME_DELTA(start_time, end_time).time.minute,
    30
  )
SELECT
  ADD_TO_DATETIME(start_time, offset, "minutes")

@ismaen I’m curious if this can be adapted to take now() to get a list of time at 15 minute interval.

Like if I have check time of 905am. I want to see time slot of 830, 845, 900, 915am.

@jeff_groupwork oh interesting. something like this?

FROM
  offset
IN
  RANGE(
    0,
    DATETIME_DELTA(
      NOW(),
      ADD_TO_DATETIME(NOW(), 60, "minutes")
    ).time.minute,
    15
  )
SELECT
  ADD_TO_DATETIME(
    SUBTRACT_FROM_DATETIME(NOW(), 30, "minutes"),
    offset,
    "minutes"
  )

This essentially outputs increments of 15 minutes with the current time in between:

(formatted for readability, but the output would be datetimes)

[
  "2022-08-16T23:54:28Z",
  "2022-08-17T00:09:28Z",
  "2022-08-17T00:24:28Z",
  "2022-08-17T00:39:28Z",
  "2022-08-17T00:54:28Z"
]