I made a daemon that it is started by systemd, and inside my daemon I have a python function to get the time. The problem is that the time is wrong, I have 8 hours of difference.
This is my service script:
[Unit]
Description=auto-sync daemon
[Service]
ExecStart=/bin/bash -c "/usr/bin/auto-sync -s"
[Install]
WantedBy=basic.target
I've tried multiple ways of getting the hour in python but they are all wrong.
from datetime import datetime
datetime.now().strftime("%d-%m-%Y %H:%M:%S")
I told my self that the problem could be the fact that some weird system user is running the script, so I added: User=root
but I still having the same problem! Any Idea?
I actually didn't wanted to add +8 hours because I'm not sure if all the users of my program have the same problem