SQLSERVER?
-------------
declare @timea datetime ,@timeb datetime
set @timea='2023-06-13 20:30'
set @timeb='2023-06-14 08:30'
select DATEADD(MINUTE,a.number*5,@timea) as [划分结果]
from master..spt_values a with(nolock),master..spt_values b with(nolock)
where a.type='P' and b.type='P'
and DATEADD(MINUTE,b.number,@timea)<=@timeb
and a.number=b.number