How to read the build number
http://kb.vmware.com/kb/1012514 - Determining detailed build number information for VMware ESX 4.0.x hosts
http://kb.vmware.com/kb/1001179 - Determining detailed build number information for VMware ESX 3.0.x and 3.5.x hosts
http://kb.vmware.com/kb/392 - Determining VMware Software Version and Build Number
Service/Management Console mode
The build number at server console is the version of the VMware Kernel.
To read this number use this command:
VIC or VS Client mode
The build number which you see at vSphere Client is the hostagent version number.
For example, for ESX 4.0, after installing the latest patches your server console would show 193498, vSphere Client would show 175625. If you have installed patches released on 08/06, then the console would show 181792 and vSphere client would show 175625.
Convert a build number in a ESX version
For the major releases, not including patches between roll-ups, you can look at the download page (for each product version you see also the relative build number).
Or the quick and dirty solution is to google the build number
The build number for vSphere 4.0U1 is 208167
To know the applied patch you can use:
esxupdate -l info