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

Container time should be same timezone as user #709

Closed
rfay opened this issue Mar 3, 2018 · 7 comments
Closed

Container time should be same timezone as user #709

rfay opened this issue Mar 3, 2018 · 7 comments

Comments

@rfay
Copy link
Member

rfay commented Mar 3, 2018

What happened (or feature request):

It's hard to read and understand logs from the containers as they're in GMT. It would be pretty easy to set them to be the same as the host timezone (I think).

What you expected to happen:

How to reproduce this:

Version: Please include the output of ddev version, docker version and the project's .ddev/config.yaml.

Anything else do we need to know:

Related source links or issues:

Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)

@rickmanelius
Copy link
Contributor

That's reasonable. Looks actionable as is.

@rfay
Copy link
Member Author

rfay commented Mar 11, 2018

So far this isn't as easy as I would have thought.

	t := time.Now()
	tz, offset := t.Local().Zone()
	if offset < 0 {
		offset = offset * -1
	}
	zone := "XXX" + strconv.Itoa(offset/3600) + tz

@rickmanelius
Copy link
Contributor

I know this wouldn't work with tail, but would it be crazy to address this as a regex replacement at the time of output? That seems silly that macOS requires sudo just to know timezone... I can't see how that would be a security attack vector.

@rfay
Copy link
Member Author

rfay commented Mar 11, 2018

There are so many different kinds of output that it's too painful to imagine. And people like me may want to work inside the container and see reasonable times.

@rickmanelius
Copy link
Contributor

Completely fair. I was spitballing. Looks like we're then blocked unless/until this gets addressed upstream, correct?

@rfay
Copy link
Member Author

rfay commented Mar 11, 2018

Not blocked, just frustrated. It's probably solvable, might be slightly more effort than I expected. I was just trying to write down what I learned.

@rfay
Copy link
Member Author

rfay commented May 9, 2018

Most people don't need this, and for the ones that do there's a super easy workaround adding a $TZ environment variable, https://stackoverflow.com/questions/50255466/how-can-i-set-the-timezone-in-my-ddev-containers/50255467#50255467 - I think this is better than adding extra code to our codebase.

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

No branches or pull requests

2 participants