UTM zone is one of sixty 6 degree wide bands numbered from west to east (1-60). It requires only a longitude value. Either of these Python expressions will work (the second slightly faster, but more obscure):
zone = int(longitude + 180.0) / 6 + 1
zone = int(longitude + 186.0) / 6
UTM Zone can also refer to one of 120 band segments (north and south), which would then require a longitude value and be represented as a string:
zone = str(int(longitude + 186.0) / 6) + ('S' if (latitude < 0) else 'N')
Even though it is not strictly part of a UTM zone designations, many also use the military grid reference system (MGRS) band designators to slice the 164 degrees of UTM-addressed meridians (from 80S to 84N) into mostly 8 degree tall bands, lettered 'C' through 'X' (skipping 'I' and 'O') -- the 'X' band is 12 degrees tall. MGRS uses 'A' and 'B' for south of 80S (west and east of the Prime Meridian, respectively) and 'Y' and 'Z' for north of 84N (similarly).
The following Python function takes a
geometry parameter and generates a three character formatted string suitable as a rough spatial index hash based on MGRS (fixed-width, so 1X would be rendered
01X, and lexographic sorting is possible):
bandVals = "CDEFGHJKLMNPQRSTUVWXX"
if (not geom):
ddLon = geom.extent.XMin
ddLat = geom.extent.YMax
zone = int(ddLon + 186.0) / 6
if (ddLat >= 84.0):
band = 'Y' if (ddLon < 0.0) else 'Z'
elif (ddLat <= -80.0):
band = 'A' if (ddLon < 0.0) else 'B'
band = bandVals[int(ddLat + 80.0) / 8]
Note that this is different from the Esri utility, since it uses the upper-left corner of the geometry, not the centroid to identify the zone and band.
Generating a UTM spatial reference string would be simple enough, given the second code block (with direction). The trickiest part would be to extract GeogCS from the current map canvas.