Template sensor not updating the state

I don’t know if i just don’t the correct way to use it. Or it maybe a bug?
But have made a template sensor with the following satement

{{ (as_timestamp(states.sensor.calc_leave_time.state) - as_timestamp(now()))  | int }}

and that gives me a number at start up, but it never updates when the time changes.
Only when again restart hass it will update.

Bug or wrong configuration?

Okay i think i found the problem. It was because that i use:

now()

And that should render as current time in my timezone, as stated in the documentation.

Did you manage to get it right?