I am not sure I understand how you are determining the times.
Extract the array of samples from the waveform (Get Waveform Components.Y). The calculate the start index and the length of the interval in terms of the array index. For example the length is [duration/dt]. Convert the result to I32 datatype because that is what the array functions need for index and length. Use Array Subset to get the portion of the array you want. If you want to go back the the waveform datatype, use the Build Waveform function with the original waveform and Ysubset as inputs.
Repeat in a loop as needed. Probably a while loop rather than the for loop you have. The for loop will attempt to repeat the process for each element in the array, which is not what I think you want.