extern variable tzname is not set correctly for Australia/Sydney timezone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tzdata (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
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.
ProcVersionSign
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)
PackageArchitec
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: tzdata
Define "incorrect" here. I assume Sydney wasn't on daylight time when you checked, so the output above looks correct. Unless you were expecting "AEST" instead of "EST"? (Note that both forms are "correct", depending on who you ask, where they live, and how much they enjoy ambiguity).