luxon
                                
                                
                                
                                    luxon copied to clipboard
                            
                            
                            
                        Interval.splitBy for seconds
Interval.fromDateTimes(day.set({ day: firstDay, 'hour': 0, 'minute':0 }), day.set({ day: firstDay, 'hour': 2, 'minute':0, 'seconds':30 })).splitBy('hour') return 2 elements
Interval.fromDateTimes(day.set({ day: firstDay, 'hour': 0, 'minute':0 }), day.set({ day: firstDay, 'hour': 2, 'minute':1, 'seconds':0 })).splitBy('hour') return 3 elements
Expected result. 3 elements in both cases
The code you have posted doesn't actually work, splitBy expects a Duration, not a string. Please also post the values for day and firstDay as well as your time zone. I suspect you are observing the effects of DST.