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

Timezone tests fail on Windows #1

Open
osteele opened this issue Aug 11, 2017 · 1 comment
Open

Timezone tests fail on Windows #1

osteele opened this issue Aug 11, 2017 · 1 comment

Comments

@osteele
Copy link
Owner

osteele commented Aug 11, 2017

See https://ci.appveyor.com/project/osteele/tuesday:

go test ./...
--- FAIL: TestStrftime (0.05s)
	Error Trace:	strftime_test.go:134
	Error:      	Not equal: 
	            	expected: "Mon Jan  2 15:04:05 EST 2006"
	            	actual: "Mon Jan  2 15:04:05  2006"
	Messages:   	Strftime "%+"
--- FAIL: TestStrftime_zones (0.00s)
	Error Trace:	strftime_test.go:207
	Error:      	Not equal: 
	            	expected: "%z=-0500 %Z=EST"
	            	actual: "%z=+0000 %Z=EST"
	Messages:   	02 Jan 06 15:04 EST
--- FAIL: ExampleStrftime_timezone (0.00s)
got:
EDT +0000 +00:00 +00:00:00
@osteele
Copy link
Owner Author

osteele commented Aug 12, 2017

The issue was that setting the TZ environment variable has no effect on Windows.

The tests now pass if you set the timezone before running the tests, e.g. tzutil /s "Eastern Standard Time".

This fixes the appveyor, but is a gotcha for Windows development.

A fix is to remove the reliance on system timezone entirely, and update the tests to parse time strings in EST instead of local.

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

1 participant