How to get bar index from datetime?

Is there a way to get the chart bar index in a specific time frame from a datetime variable?

skatt:

Is there a way to get the chart bar index in a specific time frame from a datetime variable?


iBarShift
Thanks!