Retrieving the ServiceInstance Object on a vSphere Host
You can retrieve the ServiceInstance object to access the ServiceContent or to retrieve the current time on an ESX/ESXi or vCenter Server system.
If you want to retrieve the current time, you must retrieve a ServiceInstance object and call its CurrentTime() method. You can use the Vim::get_service_instance() subroutine to retrieve the object.
To retrieve the current VMware host time
1
Util::connect();
2
Retrieve the ServiceInstance object:
my $service_instance = Vim::get_service_instance();
3
$service_instance->CurrentTime();