PMISETTIMEZONE(3)
π PMISETTIMEZONE(3) β the Library Functions Manual glow-up π
okay bestie, welcome to pmiSetTimezone and pmiSetZoneinfo π«Ά they live in the Library Functions Manual, and they're here to sort out the source timezone for your LOGIMPORT archive. no cap, this one's short but it matters.
β¨ NAME β¨
pmiSetTimezone, pmiSetZoneinfo β set the source timezone for a LOGIMPORT archive π
π C SYNOPSIS π
#include <pcp/pmapi.h>
#include <pcp/import.h>
int pmiSetTimezone(const char *value);
int pmiSetZoneinfo(const char *value);
cc ... -lpcp_import -lpcp
link it like that, periodt. π
π¦ Perl SYNOPSIS π¦
use PCP::LogImport;
pmiSetTimezone($value);
yes queen, Perl said "I also want in" πΈ
π Python SYNOPSIS π
from pcp import pmi
log.pmiSetTimezone(value)
slay, Python girlies are covered too π
πΈ DESCRIPTION πΈ
so this whole thing is part of the Performance Co-Pilot Log Import API (peep LOGIMPORT(3) if you wanna go deeper π).
pmiSetTimezone sets the POSIX timezone string in the current context to value, and that value gets stored in the archive label. π·οΈ and here's the thing β if you never call pmiSetTimezone, the source timezone just defaults to the timezone of the localhost. like, it picks for you. cute of it, honestly.
pmiSetZoneinfo sets the Olson (tzdata) timezone name for the archive, and the whole point is that it gives you higher-fidelity timezone info than the POSIX string can do on its own. it's giving β¨ extra detail β¨.
now, the tea on the argument:
- if
valueisNULL,pmiSetZoneinfoauto-detects the Olson name for the current local timezone from the system timezone database π΅οΈβοΈ - if no Olson name can be determined, the call is a silent no-op (not me getting ignored by a function π)
- if you pass an explicit Olson name like
America/New_York, it stores it directly, no lookup, no drama π½
and the zoneinfo string gets written into v3 archives right alongside the POSIX timezone string. they're a duo, iykyk π«Ά
π DIAGNOSTICS π
both functions return zero on success, or a negative value when things go sideways. that negative value can be turned into an actual error message by calling pmiErrStr(3) β so like, always do that, bestie, don't just stare at the negative number like it owes you money π
π SEE ALSO π
go read those next, they're all part of the same friend group π
Performance Co-Pilot made this, and honestly? iconic behavior. that's the source, that's the vibe, that's the whole page β mwah, stan π β¨π¦
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2010 Ken McDonell. All Rights Reserved
- Copyright (c) 2026 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms