Bug 30839

Summary: TimeZone-related code fails on PPC64 little-endian if "TZ" env is not set
Product: [Mono] Class Libraries Reporter: Jo Shields <jo.shields>
Component: mscorlibAssignee: marcos.henrich
Severity: normal CC: masafa, mono-bugs+mono, saper
Priority: ---    
Version: master   
Target Milestone: Untriaged   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description Jo Shields 2015-06-05 08:04:25 UTC
This is bizarre.

If TZ is set to the value in /etc/timezone, it;s fine.

If TZ is set to a different valid timezone, it's fine.

If TZ is set to a garbage value that doesn't exist, it's fine.

If TZ is not set, exception.

minicloud@debianle:/tmp$ TZ=America/Sao_Paulo mono tztest.exe 
6/5/2015 10:14:00 AM
minicloud@debianle:/tmp$ cat /etc/timezone 
minicloud@debianle:/tmp$ mono tztest.exe 

Unhandled Exception:
System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.
Comment 1 Jo Shields 2015-06-05 10:29:27 UTC

*** This bug has been marked as a duplicate of bug 30360 ***
Comment 2 Marcin Cieślak 2015-06-08 03:32:35 UTC
It occurs to me that only /etc/localtime and /usr/share/zoneinfo/... are tried, /etc/timezone is not used at all. Note they are different: /etc/timezone contains the name of the zone, and /etc/localtime.

I can see that /etc/timezone is a debianism, and debian's tzsetup updates *both* /etc/timezone and /etc/localtime, the latter should work with Mono.

I'd say supporting /etc/timezone is a non-standard extension that is not necessary for most cases (are there relatively modern systems setting /etc/timezone and not setting /etc/localtime?)
Comment 3 Marcin Cieślak 2015-06-08 03:33:08 UTC
Note they are different: /etc/timezone contains the name of the zone, and /etc/localtime contains the actual time zone data.