PMCONVERTTIME(3)
π PMCONVERTTIME(3) β the one where we turn a tm into actual seconds π
okay bestie, gather round, because this is a page from the Library Functions Manual and it's literally about converting tm structures into seconds. it's giving internal-PCP-developer energy, iykyk π«Ά
β¨ NAME β¨
__pmtimevalConvert, __pmtimespecConvert β convert tm structure into seconds π
πΈ C SYNOPSIS πΈ
#include "pmapi.h"
#include "libpcp.h"
int __pmtimevalConvert(struct tm *tmin, struct timeval *origin,
struct timeval *rslt);
int __pmtimespecConvert(struct tm *tmin, struct timespec *origin,
struct timespec *rslt);
cc ... -lpcp
like, that's the whole vibe right there. two functions, one #include pair, and you link with -lpcp. iconic. π
π CAVEAT π
no cap, this one comes with a warning label, and you need to read it.
this documentation is for internal Performance Co-Pilot (PCP) developer use. periodt.
these interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases. and they may not work, or may provide different semantics at some point in the future. π
so like⦠don't build your whole personality around them. they could change on you. fr fr.
π¦ DESCRIPTION π¦
okay so here's what's actually happening, bestie.
__pmtimevalConvert and __pmtimespecConvert accept a tm structure that has been filled in by __pmParseCtime(3) β plus a reference time point called origin β and then they fill in the given rslt structure with the time the user actually meant when they were specifying a partial ctime, or a positive or negative time interval. β¨
typically, the argument origin is the start time for a set of PCP archivesβ¦ unless the user specified a negative interval offset, in which case it is the end time of the archive. lowkey important distinction, don't sleep on it π
__pmtimevalConvert and __pmtimespecConvert return 0 if successful. they return -1 and write an error message to stderr if an error is detected. so like, check that return value, bestie, it's not just decor π
use pmNewZone(3), pmNewContextZone(3) or pmUseZone(3) to establish a new current timezone that will effect __pmtimevalConvert. π°οΈ
π SEE ALSO π
PMAPI(3)__pmParseCtime(3)__pmtimevalParse(3)pmNewContextZone(3)pmNewZone(3)pmParseInterval(3)pmParseTimeWindow(3)pmUseZone(3)
go read those too, they're all part of the same friend group π«Ά
and that's the whole page, bestie!! this was brought to you by Performance Co-Pilot (that's the PCP in the corner, mwah) β internal dev docs, no guarantees, stay hydrated, and remember: if your timezone is wrong, your conversion is wrong, and that's not a vibe. πβ¨ππ¦πΈπ
π¦ 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
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-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.1.0-6.fc44 Β· 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 resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2016 Red Hat
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms