Product SiteDocumentation Site

3.8.5. PMAPI Timezone Services

The functions described in this section provide Performance Metrics Application Programming Interface (PMAPI) timezone services.

3.8.5.1.  pmNewContextZone Function

int pmNewContextZone(void)
Python:
pmNewContextZone()
If the current PMAPI context is an archive, the pmNewContextZone function uses the timezone from the archive label record in the first archive of the set to set the current reporting timezone. The current reporting timezone affects the timezone used by pmCtime and pmLocaltime.
If the current PMAPI context corresponds to a host source of metrics, pmNewContextZone executes a pmFetch to retrieve the value for the metric pmcd.timezone and uses that to set the current reporting timezone.
In both cases, the function returns a value to identify the current reporting timezone that may be used in a subsequent call to pmUseZone to restore this reporting timezone.
PM_ERR_NOCONTEXT indicates the current PMAPI context is not valid. A return value less than zero indicates a fatal error from a system call, most likely malloc.