[Bug 1078087] Re: extern variable tzname is not set correctly for Australia/Sydney timezone

Jon Reeve 1078087 at bugs.launchpad.net
Thu Dec 19 01:23:10 UTC 2013


This is a really infuriating behaviour - just wasted half an hour
figuring out why a bunch of timestamps I just "fixed" are all
incorrectly set to -0500 rather than +1100, and then had to re-fix them
all again. Apparently it's been discussed upstream and they're OK with
the ambiguity (despite the fact that it needn't be). Ambiguity is one
thing, but this outright breaks certain behaviour, like feeding the
output of the date command into other things. If multiple timezones can
be called EST then specifying EST as an input without some
disambiguation should not be valid.

Anyway, this is kind of beyond the control of the Ubuntu guys I suspect,
and thankfully this one sane and wonderful guy has a fix to the tzdata
that he's maintaining. He's Australian, so this matters to him, as it
does to me while I'm over here. Here's your workaround:

http://tedp.id.au/tzdata-au/

Or if you just want the commands:

wget -O- http://tedp.id.au/~ted/ddd11d8a.asc | sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/tzdata-au-ubuntu.list http://tedp.id.au/tzdata-au/sources.list.d/tzdata-au-ubuntu.list
sudo apt-get update && sudo apt-get install tzdata-au

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to tzdata in Ubuntu.
https://bugs.launchpad.net/bugs/1078087

Title:
  extern variable tzname is not set correctly for Australia/Sydney
  timezone

Status in “tzdata” package in Ubuntu:
  Confirmed

Bug description:
  I compile and run the following C program on a machine whose default
  timezone is "America/New_York":

  #include <stdlib.h>
  #include <stdio.h>
  #include <string.h>
  #include <time.h>
  #include <stdint.h>
  #include <assert.h>

  void printTimezone(void) {
    printf("Timezone is now '%s/%s', %ld seconds West of UTC\n",
  	 tzname[0], tzname[1], timezone);
  }

  int main(const int argc, const char *argv[]) {
    tzset();
    printTimezone();
    setenv("TZ", "Asia/Hong_Kong", 1);
    tzset();
    printTimezone();
    setenv("TZ", "Europe/London", 1);
    tzset();
    printTimezone();
    setenv("TZ", "Australia/Sydney", 1);
    tzset();
    printTimezone();
  }

  The resulting output is:

  Timezone is now 'EST/EDT', 18000 seconds West of UTC
  Timezone is now 'HKT/HKST', -28800 seconds West of UTC
  Timezone is now 'GMT/BST', 0 seconds West of UTC
  Timezone is now 'EST/EST', -36000 seconds West of UTC

  As can be seen from the last line of the output, the values of
  tzname[0] and tzname[1] are incorrect for Australia/Sydney (seem to be
  set similarly to America/New_York) even though the value of timezone
  (i.e. seconds West of UTC) appears to be correct.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: tzdata 2012e-0ubuntu0.10.04
  ProcVersionSignature: Ubuntu 2.6.32-45.99-generic 2.6.32.60+drm33.26
  Uname: Linux 2.6.32-45-generic x86_64
  Architecture: amd64
  Date: Mon Nov 12 16:18:45 2012
  InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
  PackageArchitecture: all
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.utf8
   SHELL=/bin/bash
  SourcePackage: tzdata

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1078087/+subscriptions



More information about the foundations-bugs mailing list