It's not that difficult, even if you handle the zones around Svalbard and Norway. Here's an example:
ZoneNumber = floor((LongTemp + 180)/6) + 1;
if( Lat >= 56.0 && Lat < 64.0 && LongTemp >= 3.0 && LongTemp < 12.0 )
ZoneNumber = 32;
endif
// Special zones for Svalbard
if( Lat >= 72.0 && Lat < 84.0 )
if ( LongTemp >= 0.0 && LongTemp < 9.0 )
ZoneNumber = 31;
elseif( LongTemp >= 9.0 && LongTemp < 21.0 )
ZoneNumber = 33;
elseif(LongTemp >= 21.0 && LongTemp < 33.0 )
ZoneNumber = 35;
elseif(LongTemp >= 33.0 && LongTemp < 42.0 )
ZoneNumber = 37;
endif
endif
Convert Latitude/Longitude to UTM (attributed to Chuck Gantz).
I haven't tried this specific code, but the algorithm looks correct.