Timestamp issue - off by one hour

I have made a script that takes the timestamp from one datetime helper to another. But for some weird reason it adds an hour to the receiving datetime helper. I can find no documentation that can explain it. I have a feeling it might have something to do with UTC, but again - why? it copies from a local datetime helper to another.

alias: 'Bil: set klimaanleggtid'
sequence:
  - service: input_datetime.set_datetime
    data:
      timestamp: '{{ (state_attr(''input_datetime.bil_avreise'', ''timestamp'')|float ) }}'
    target:
      entity_id: input_datetime.bil_klimaanleggtidspunkt
mode: single

What happens if you do this?

alias: 'Bil: set klimaanleggtid'
sequence:
  - service: input_datetime.set_datetime
    data:
      datetime: '{{ states(''input_datetime.bil_avreise'') }}'
    target:
      entity_id: input_datetime.bil_klimaanleggtidspunkt
mode: single

Timestamps are not timzone “aware”. So your first conversion converts a local datetime to a datetime in UTC. This UTC time is then saved to the second input select.

Using datetime to transfer the date and time should not have this issue. I hope (not tested).