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 value is NULL, pmiSetZoneinfo auto-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