How to set input helper 'datetime' to current time/now()

I stumbled across this old thread because I could not get the fix examples working.

Does your code work for you?

Tested, not working:

alias: New Script
sequence:
  - service: input_datetime.set_datetime
    data:
      datetime: "{{ now().timestamp() | timestamp_local }}"
    target:
      entity_id: input_datetime.end_datetime
mode: single

and

alias: New Script
sequence:
  - service: input_datetime.set_datetime
    data:
      timestamp: "{{ now().timestamp() }}"
    target:
      entity_id: input_datetime.end_datetime
mode: single