Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set the locale/timezone? #4263

Open
yuis-ice opened this issue Aug 28, 2024 · 8 comments
Open

How to set the locale/timezone? #4263

yuis-ice opened this issue Aug 28, 2024 · 8 comments

Comments

@yuis-ice
Copy link

Your question

Hi. The docker result/export html date shows different time from my time (Japan), and from the computer also. How to set the locale, time, date, timezone?

@soulgalore
Copy link
Member

Hi @yuis-ice do you use the Docker container? If you add -v /etc/localtime:/etc/localtime:ro the container will use the same time as the server where it runs. Do that work for you?

@yuis-ice
Copy link
Author

Hi, I tried it but looks not working.

$ date 
Wed 28 Aug 2024 07:24:51 PM JST
$ 
$ docker run --rm -v "$(pwd)":/sitespeed.io -v /etc/localtime:/etc/localtime:ro sitespeedio/sitespeed.io https://mysite.com
Google Chrome 127.0.6533.72 
Mozilla Firefox 128.0
Microsoft Edge 126.0.2592.113 
[2024-08-28 10:24:56] INFO: Versions OS: linux 5.15.0-105-generic nodejs: v20.15.1 sitespeed.io: 34.9.0 browsertime: 22.8.0 coach: 8.0.2
[2024-08-28 10:24:56] INFO: Running tests using Chrome - 3 iteration(s)
[2024-08-28 10:24:57] INFO: Testing url https://mysite.com iteration 1

Thanks for your help.

@soulgalore
Copy link
Member

Hi @yuis-ice what OS are you using when you run the containers?

@yuis-ice
Copy link
Author

Hi, it's Ubuntu 20.04.4

@soulgalore
Copy link
Member

Looking at https://stackoverflow.com/questions/24551592/how-to-make-sure-dockers-time-syncs-with-that-of-the-host it seems people uses -v /etc/timezone:/etc/timezone:ro v- /etc/localtime:/etc/localtime:ro can you try and see if that helps?

@taozhu520222
Copy link

您的问题

你好。docker result/export html date 显示的时间与我的时间(日本)不同,也与计算机显示的时间不同。如何设置区域设置、时间、日期、时区?

What about adding the -e TZ=“Asia/Tokyo” parameter to the docker?

@yuis-ice
Copy link
Author

yuis-ice commented Sep 2, 2024

It still doesn't work with -e TZ=“Asia/Tokyo”

$ docker run --rm -v "$(pwd)":/sitespeed.io -e TZ=“Asia/Tokyo” sitespeedio/sitespeed.io https://mysite.com
Google Chrome 127.0.6533.72 
Mozilla Firefox 128.0
Microsoft Edge 126.0.2592.113 
[2024-09-02 16:50:55] INFO: Versions OS: linux 5.15.0-105-generic nodejs: v20.15.1 sitespeed.io: 34.9.0 browsertime: 22.8.0 coach: 8.0.2
[2024-09-02 16:50:55] INFO: Running tests using Chrome - 3 iteration(s)

$ date
Tue 03 Sep 2024 01:52:16 AM JST

@soulgalore
Copy link
Member

soulgalore commented Sep 2, 2024

Hmm strange, adding TZ works for me (my base OS is a Mac):

date
Mon Sep  2 22:24:53 CEST 2024

~/git/sitespeed.io main*
❯ docker run --rm -v "$(pwd):/sitespeed.io"  -e TZ="Asia/Tokyo" sitespeedio/sitespeed.io:34.11.0 https://www.sitespeed.io/ -n 1

Google Chrome 128.0.6613.84 
Mozilla Firefox 129.0
Microsoft Edge 127.0.2651.105 
[2024-09-03 05:25:04] INFO: Versions OS: linux 6.10.0-linuxkit nodejs: v20.17.0 sitespeed.io: 34.11.0 browsertime: 22.9.0 coach: 8.0.2
[2024-09-03 05:25:04] INFO: Running tests using Chrome - 1 iteration(s)
[2024-09-03 05:25:05] INFO: Testing url https://www.sitespeed.io/ iteration 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants