There was something going wrong in the kindle, no matter how much I tried to solve it or change the timezone. but what worked is adding this line
MinuteOTheDay=$(expr \( $MinuteOTheDay + 400 \) % 2400)...
I found this article when trying to get the last thursday, but it would work for any other day too. Here is my solution (compatible with Bash):
nextThursInMonth=`date -d '...
You can write dynamic parts into an environment file and use the variables later. Something like this:
Description=TCS minetest server unit