Snapshots created by API are shifted by time which they are viewed

Heres a solution for everyone who has the same problem:

unfortunately i dont get it running. Hopefully someone has an easier way to solve that. Otherwise i dont see the advantage of taking snapshots by API.

best regards,
alessio