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

set time zone 'asia/kolkata'; timezone data cannot be found in ubuntu #31297

Closed
irshadhasmat opened this issue Oct 12, 2018 · 16 comments
Closed
Labels
C-investigation Further steps needed to qualify. C-label will change. O-community Originated from the community

Comments

@irshadhasmat
Copy link

When I am trying to set timezone in ubuntu server by the command:
set time zone 'asia/kolkata';

I am getting pq: cannot find time zone "asia/kolkata": timezone data cannot be found

where as this command run without issue in Mac.

I tried to execute this command on cockroach 2.0.5 and 2.0.6

Server version: CockroachDB CCL v2.0.6 (x86_64-unknown-linux-gnu, built 2018/10/01 13:59:40, go1.10) (same version as client)

oot@:26257/> set time zone 'asia/kolkata';
pq: cannot find time zone "asia/kolkata": timezone data cannot be found
root@:26257/>

@jordanlewis jordanlewis added O-community Originated from the community C-investigation Further steps needed to qualify. C-label will change. labels Oct 12, 2018
@jordanlewis
Copy link
Member

Hmm, I think we get our timezone information from the system. Perhaps your tzinfo files need updating on Ubuntu?

@mberhault
Copy link
Contributor

mberhault commented Oct 12, 2018

TImezones in linux are case sensitive:

root@:26257/defaultdb> show time zone;
  timezone  
+----------+
  UTC       
(1 row)

root@:26257/defaultdb> set time zone 'asia/kolkata';
pq: invalid value for parameter "timezone": "'asia/kolkata'"
DETAIL: cannot find time zone "asia/kolkata": timezone data cannot be found

root@:26257/defaultdb> set time zone 'Asia/Kolkata';
SET

root@:26257/defaultdb> show time zone;
    timezone    
+--------------+
  Asia/Kolkata  
(1 row)

@irshadhasmat
Copy link
Author

Thanks @mberhault for your support.

@pmneo
Copy link

pmneo commented Oct 16, 2018

Similar problem here with Europe/Berlin on a Windows machine:

root@:26257/defaultdb> set time zone 'europe/berlin';
pq: invalid value for parameter "timezone": "'europe/berlin'"
DETAIL: cannot find time zone "europe/berlin": timezone data cannot be found

root@:26257/defaultdb> set time zone 'Europe/Berlin';
pq: invalid value for parameter "timezone": "'Europe/Berlin'"
DETAIL: cannot find time zone "Europe/Berlin": timezone data cannot be found
root@:26257/defaultdb>

@pungggi
Copy link

pungggi commented Nov 16, 2018

Hi @pmneo did you find a solution?

@pmneo
Copy link

pmneo commented Nov 16, 2018

@pungggi unfortunately, no. It seems that just few people are interessted in running this on windows ...

@pungggi
Copy link

pungggi commented Nov 16, 2018

@pmneo my quick 'fix' ist to change the timezone of the machine to UTC.. 🥇 👎

@knz
Copy link
Contributor

knz commented Nov 16, 2018

@pmneo @pungggi See the answer above at #31297 (comment)

  1. the time zone is case snesitive. The solution is Europe/Berlin or Asia/Kolkata

  2. the time zone names are different depending on the OS. The names Europe/Berlin and Asia/Kolkata will work on Linux/macOS but not on windows.

@pmneo
Copy link

pmneo commented Nov 16, 2018

@knz have you read my post #31297 (comment) ?

'Europe/Berlin' is no solution for that problem under windows:
root@:26257/defaultdb> set time zone 'Europe/Berlin';
pq: invalid value for parameter "timezone": "'Europe/Berlin'"
DETAIL: cannot find time zone "Europe/Berlin": timezone data cannot be found
root@:26257/defaultdb>

@knz
Copy link
Contributor

knz commented Nov 16, 2018

Have you read my answer?

the time zone names are different depending on the OS. The names Europe/Berlin and Asia/Kolkata will work on Linux/macOS but not on windows.

@pmneo
Copy link

pmneo commented Nov 16, 2018

yes, but you have not told me which is the correct one. I have tried Europe/Berlin and europe/berlin ...

@knz
Copy link
Contributor

knz commented Nov 16, 2018

Have you tried "CET"? That's the standard zone name. I am not sure windows support city-based zone names at all.

@pungggi
Copy link

pungggi commented Nov 16, 2018

root@:26257/defaultdb> set time zone CET;
pq: invalid value for parameter "timezone": "'cet'"
DETAIL: cannot find time zone "cet": timezone data cannot be found

@knz
Copy link
Contributor

knz commented Nov 17, 2018

@BramGruneir can you have a quick look? Is Go unable to load named timezones on windows whatsoever?

@knz
Copy link
Contributor

knz commented Nov 17, 2018

@pungggi in the meantime please create as separate issue. This issue about timezones on Ubuntu. We're having an unrelated conversation now.

@pungggi
Copy link

pungggi commented Nov 17, 2018

Already opened #32415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-investigation Further steps needed to qualify. C-label will change. O-community Originated from the community
Projects
None yet
Development

No branches or pull requests

6 participants