Cumulative duration

Hi there, I’m looking for solution to show total duration of state (1) in my time series (D1+D2) for selected time interval
I found using Discrete plugin that is shows duration in Legend but rounded to days
Thanks in advance for any help