Add direction of photo from GPX file

As I can read from the man page, %z is a formatting option that prints the time zone offset. I assume you use something like date --reference 405MEDIA_Y4820388.jpg '+%z' and then it prints e.g. +0100
I don’t know if it will always work or only some times, but it is good to be aware that any copying of the files on a bad time (e.g. files taken with DST in effect and a copy made with DST not in effect) may break the solution.

The only good automatic solution I have found is to use a webservice to get the time zone offset and DST offset from a webservice, where you provide the coordinates and time as arguments. Doing it for the first picture of every sequence should usually do. But this subject is a pain and I always hope to find the perfect universal solution. I still do it by hand.