What timezone does DST refer to?

Viewed 1114

I'm using WSL with ubuntu 16.04, and was having network issues today. Here's what date outputs

$ date
Thu Sep 21 13:37:00 DST 2017

What does DST refer to? I know it stands for "Daylight savings time", but that's not a timezone name. I'm suspicious that it's a contrived timezone that changes on the equinox, which would explain my problem today.

I was able to fix my problem by setting my timezone to US/Pacific, which changed the output to PDT:

$ date
Thu Sep 21 13:37:00 PDT 2017

However, I have a second machine with the same problem, and am curious what timezone it thinks its in.

Is there anyway to get the X/Y string (Olson database name) that corresponds to DST out of the system?

3 Answers

TL;DR WSL Dynamically generates a fake timezone info file at /usr/share/zoneinfo/Msft/localtime that in hard linked to /etc/localtime. The Msft file uses the made up names DST or STD, and they stand for no specific timezone.


What is actually going on is WSL attempts to match your Windows timezone in Linux. This is a non-trivial mapping, as seen here (discussion). So rather than trying to hit a constantly moving target, what I believe WSL does is use the Windows API to get the Windows Timezone info, and based off of that information, it dynamically generates a timezone info file.

I believe that wslhost (specifically code in C:\Windows\System32\lxss\LxssManager.dll) does this inspection on your current timezone in Windows, and writes to the the /usr/share/zoneinfo/Msft/localtime file. This is why when the timezone in Windows changes, you see the affect in an already running WSL instantly. But since there is no perfect mapping from Windows timezones to Linux or POSIX timezones, wslhost probably just wings the name, and that's where the DST comes into play.

Update: Actually, I think it just says "DST" if you are in Daylight Saving Zone timezone, and "STD" for non DST timezone (Standard I assume).

So the answer to "What timezone does DST stand for" is none, and any Linux program that will attempt to match /etc/localtime to a timezone file in /usr/share/zoneinfo (via readlink or just searching), will only every get "Msft/localtime" as an answer. A "Technically accurate, but totally useless" answer.

UPDATE: This answer is likely wrong; the output reported by the OP is inconsistent with my hypothesis.

I believe it's an unrecognized time zone, interpreted as UTC by the date command.

On my Ubuntu 14.04 system:

$ date -u ; TZ=DST date ; TZ=NOSUCHTIMEZONE date
Thu Sep 21 21:04:44 UTC 2017
Thu Sep 21 21:04:44 DST 2017
Thu Sep 21 21:04:44 NOSUCHTIMEZONE 2017
$ 

Probably something set your $TZ environment variable to DST.

Check your environment (echo $TZ). If it doesn't print DST, I'm wrong. (EDIT: The OP says $TZ is empty.)

(There's nothing called DST under /usr/share/zoneinfo.)

Related