Replies: 2 comments 1 reply
-
Hi, thank you for this. I am not aware with issues with resolving timezones in docker. Few preliminary checks: The docker-compose definition you posted has two spaces between the dash and the the TZ, that could be problematic Ontime will use the system time, so as long as the docker container is setup correctly I see no reason for this to fail. If the above doesnt give us a clue, we could make a new file const now = new Date();
console.log('now', now);
console.log('timezone offset', now.getTimezoneOffset());
console.log('locale time string', now.toLocaleTimeString());
console.log('now string', now.toString());
console.log(
'resolved system IANA',
new Intl.DateTimeFormat().resolvedOptions()
); in my local machine this resolves to
This may give us some clues to the offset you are currently experiencing and whether it is node that cannot see the timezone. |
Beta Was this translation helpful? Give feedback.
-
Carlos...
Thanks for your response. I was able to fix it by re-starting docker-compose. It then grabbed my location info from docker-compose.yml and worked correctly.
Thanks!
Les
—
Les Brown
Founder -Showmakers
www.Showmakers.app
Freelance Live Event Production
Video Director, TD, EIC
p: 214.690.2648
…On Mar 6, 2024 at 2:32 AM -0600, Carlos Valente ***@***.***>, wrote:
Hi, thank you for this.
I am not aware with issues with resolving timezones in docker.
How offset is the time, is the time maybe in UTC?
Few preliminary checks:
The docker-compose definition you posted has two spaces between the dash and the the TZ, that could be problematic
Ontime will use the system time, so as long as the docker container is setup correctly I see no reason for this to fail.
Mind you that the docker container will have a different timezone from the raspberry pi. We want to confirm the time in the container.
As you mentioned, using the date command should confirm to us whether the time is set correctly.
If the above doesnt give us a clue, we could make a new file test.js and run it in the docker container with node test.js
const now = new Date();
console.log('now', now);
console.log('timezone offset', now.getTimezoneOffset());
console.log('locale time string', now.toLocaleTimeString());
console.log('now string', now.toString());
console.log(
'resolved system IANA',
new Intl.DateTimeFormat().resolvedOptions()
);
in my local machine this resolves to
now 2024-03-06T08:28:09.045Z
timezone offset -60
locale time string 09:28:09
now string Wed Mar 06 2024 09:28:09 GMT+0100 (Central European Standard Time)
resolved system IANA {
locale: 'en-GB',
calendar: 'gregory',
numberingSystem: 'latn',
timeZone: 'Europe/Oslo',
year: 'numeric',
month: '2-digit',
day: '2-digit'
}
This may give us some clues to the offset you are currently experiencing and whether it is node that cannot see the timezone.
If none of this helps I will try and spin up an instance to help you debug
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I've set the timezone in my docker-compose.yml file but can't seem to get it to change in Ontime. My raspberry pi yields the correct date and time when I use "date" in the command line.
My docker-compose.yml file is as follows:
Beta Was this translation helpful? Give feedback.
All reactions