How to create Design Matrix for GLMSingle

I want to create design matrix from events.tsv file having the stimulus onset offset and other details of the experimental procedure. I read in the documentation that we only need to specify the onset of the stiumulus. But nilearn returns design matrices with 1s at all timepoints where the stimulus was on? If anyone can help me out with this