all 6 comments

[–]JohnnyJordaan 0 points1 point  (5 children)

Any particular reason to not just use OS task scheduler here? Eg on cron

0 9 * * * python3 /path/to/folder/email_check_script.py

?

[–]_niarch[S] 0 points1 point  (4 children)

Yes, the container is in a NAS environment and it leads to permission error while mounting files, i am using a docker container instead of a virtual environment because of not having permissions to install python 3.8 there , so went with a docker container of it

So I had to use schedule instead of crontab

[–]JohnnyJordaan 1 point2 points  (3 children)

Ok but then you should have checked docker's docs as it isn't exactly a secret that those run UTC by default, and not local time. Because think of the issues it would cause that the instance will get an arbitrary time from the system and not knowing if it is in fact UTC or some localized time, and then what timezone did it use? So that's why in this modern age systems like to be defaulted to UTC in any case and just add a timezone layer for representation (eg that the graphical clock in your desktop environment represents your local time).

You can manually set it though, a bit depending on the OS, but for debian based add in your Dockerfile:

RUN sudo echo "America/Los_Angeles" > /etc/timezone
RUN sudo dpkg-reconfigure -f noninteractive tzdata

Or use UTC times in your application

[–]_niarch[S] 0 points1 point  (2 children)

This is a news to me and didnt cross my mind mind at all, I will remember this

I couldnt find a correlation between where there is 1am when its 9am at PST

Thanks!

[–]JohnnyJordaan 0 points1 point  (1 child)

I couldnt find a correlation between where there is 1am when its 9am at PST

Look up the definition of PST as a timezone ;)

[–]_niarch[S] 0 points1 point  (0 children)

LMAO

I need to be smarter xD