g | x | w | all
Bytes Lang Time Link
083Bash on linux250102T130218ZThemooni
136C++ clang250110T204329Zjdt
178Go + zgo.at/tz250110T170230Zbigyihsu
113C#250102T191332ZEzlandin
085Bash250106T185755ZAlexJ
115Charcoal250106T110637ZNeil
104JavaScript Node.js250102T110253ZArnauld
159Wolfram Language Mathematica250102T134039ZIntroduc
085R250103T093836Zpajonk

Bash on linux, 83 bytes

-2 bytes by corvus_192 by using /usr/share/zoneinfo/posix/ + find
-6 bytes by AlexJ who needs rep to comment, by optimizing the path and command further
-2 bytes by me by optimizing the regex from [0:]{8} to 00:00:, which also allows removing the E flag from grep.

cd /*/*/z*x/;find * -exec sh -c "TZ={} date -d$1UTC|grep -q 00:00:" \; -print -quit

Attempt This Online!

Explained:

cd /*/*/z*x/; #in /usr/share/zoneinfo-posix/posix:
find * -exec sh -c #for every file in the tree, execute:
                   "TZ={} date -d$1UTC #construct a date in that timezone from UTC
                    |grep -q 00:00:"   #and check that it contains "00:00:00"
                    \; -print -quit    #if it does, print the filename and stop finding additional files
}

C++ (clang), 222 220 136 bytes

#import<bits/stdc++.h>
#define f(t,o)for(auto&z:std::chrono::get_tzdb().zones)o=std::format("{:%H:%M}",z.to_local(t))>"00:00"?o:z.name()

Try in godbolt

Go + zgo.at/tz, 178 bytes

import(."time";T"zgo.at/tz")
func f(t Time)string{for _,z:=range T.Zones{Z:=z.Zone
l,e:=LoadLocation(Z)
if e!=nil{continue}
h,m,s:=t.In(l).Clock()
if h+m+s<1{return Z}}
return""}

Attempt This Online!

The zgo.at/tz package provides a tz.Zones slice which has many time zone names. The solution loops through each zone, constructs a Location, and gets the input time in that Location. If it is midnight there, it returns early with the zone name.

20 bytes are wasted on an error check because there's a single zone name in the library that Go doesn't know about.

Some things I've learned:

C#, 135 131 130 120 113 bytes

-4 bytes, alias System.TimeZoneInfo to 'Z' instead of returning a string

-1 byte thanks to @jdt, use 'dynamic' instead of 'DateTime' as the type of 't'

-10 bytes thanks to @Themoonisacheese, check Ticks < 1 rather than Ticks == 0, use Linq 'Last' instead of 'Where' and 'First'

-7 bytes from @jdt, use 'ConvertTime' instead of 'ConvertTimeFromUtc'

using Z=System.TimeZoneInfo;Z F(dynamic t)=>Z.GetSystemTimeZones().Last(x=>Z.ConvertTime(t,x).TimeOfDay.Ticks<1);

Try it online!

Explanation

using Z = System.TimeZoneInfo;                               // Alias TimeZoneInfo as 'Z' to save space

Z F(dynamic t)
{
    return Z.GetSystemTimeZones()                            // Get all time zones
        .Last(x => Z.ConvertTime(t, x).TimeOfDay.Ticks < 1); // Find the last time zone where the time is midnight when converted into time zone x
}

Bash, 85 bytes

Don't have enough rep to comment, slightly shorter Bash implementation based on Themoonisacheese. env is unnecessary and the directory can be slightly adjusted:

cd /*/*/z*x/;find * -exec sh "TZ={} date -d$1UTC|grep -qE [0:]{8}" \; -print -quit

Attempt This Online!

Charcoal, 115 bytes

≔↨I⪪S:⁶⁰θF¬﹪θ¹⁵§⪪”}∧ΠX⁴G_↙'Y »oa?⦃ρi▷êC~Q_⁸a^d✂⎚~X·*M⊞◧H⁶⧴5⦃Z⌕‹[M→⁷¤)C⊞r⊘(Y=⟧t⌈G\⁼H¶℅^b²:IK←⊟MV⁻VιT'D⟧↧E↙8Y✂↙” θ¿ⅈT

Try it online! Link is to verbose version of code. Explanation:

≔↨I⪪S:⁶⁰θ

Convert the input into a number of minutes since midnight.

F¬﹪θ¹⁵

If that's a multiple of 15, then...

§⪪”...” θ

... used that to index into a compressed look-up table of time zone abbreviations. The table is 97 entries long but cyclically indexed so for instance 360 minutes is actually found at position 69. (Note that some abbreviations are used for multiple time zones, so for instance CST is Central Standard Time, not China nor Cuba.)

¿ⅈT

If a time zone was found then output its final T.

JavaScript (Node.js), 104 bytes

-1 thanks to @Shaggy
-3 thanks to @l4m2

Expects a string in HH:MM format. Returns either a string or undefined.

h=>Intl.supportedValuesOf(s="timeZone").find(t=>new Date([1,h]).toLocaleTimeString("es",{[s]:t})<"0:01")

Attempt This Online!

Commented

h =>                    // h = input string
Intl.supportedValuesOf( // get the list of supported values for ...
  s = "timeZone"        //   ... "timeZone"
)                       //
.find(t =>              // for each time zone t:
  new Date([1, h])      //   build a date from the string "1,HH:MM"
  .toLocaleTimeString(  //   and turn it into a time string
    "es",               //   using the Spanish locale
                        //   (24-hour format without the leading 0)
    { [s]: t }          //   and the time zone t
  )                     //
  < "0:01"              //   is it midnight there?
)                       // end of find()

Alternate version (also 104 bytes)

This one is internally using the Finnish format HH.MM.SS.

h=>Intl.supportedValuesOf(s="timeZone").find(t=>new Date([1,h]).toLocaleTimeString("fi",{[s]:t})<.001+s)

Attempt This Online!

Wolfram Language (Mathematica), 179159 bytes

(u=TimeZone->"UTC";d=DateList@u;d[[-3;;-2]]=#;DateSelect[Cases[TimeZoneConvert[d~DateObject~u,#]&/@EntityList["TimeZone"],_DateObject],#Hour==0&&#Minute==0&])&

Try it online!

This code takes into account day light savings.

It converts a {h,m} input into a UTC DateObject as of today. It then filters a list of all timezones available with a {12,00} hour and minute component.

Note:

  1. This does not work on TIO as it requires an internet connection to download EntityList["TimeZone"].

  2. There is a bug in Mathematica EntityList["TimeZone"] producing invalid timezones. To work around this I used Cases[...,_DateObject] to filter out the invalid timezones. Code would be 19 bytes shorter without the bug. (I have reported the bug to Wolfram).

Edit: -20 bytes thanks to inspiration from att to reduce the code to generate the DateObject d

R, 113 85 bytes

\(t,o=OlsonNames())o[format(do.call(c,Map(as.POSIXlt,o,x=Sys.Date())),"%H:%M")==t][1]

Attempt This Online!

Works on machines with R in UTC time.

Abuses the fact that "using c on POSIXlt objects converts them to the current time zone" (from documentation).