PMCTIME(3)
π PMCTIME(3) β the pmCtime glow-up π
okay bestie, so this one lives in the Library Functions Manual and it's a little function called pmCtime and it's literally here to format the date and time for a reporting timezone. cute, right? π
β¨ NAME β¨
pmCtime β format the date and time for a reporting timezone π°οΈ
πΈ C SYNOPSIS πΈ
#include <time.h>
#include <pcp/pmapi.h>
char *pmCtime(const time_t *clock, char *buf);
cc ... -lpcp
π¦ DESCRIPTION π¦
okay so pmCtime is very similar to ctime(3), bestie, with two little twists that make it that girl:
- the timezone it uses is the current
reporting timezoneβ not the defaultTZenvironment variable scheme π«Ά - the result gets returned into a caller-declared buffer β not some private buffer it keeps to itself π
Like ctime(3), the time you wanna convert gets passed in via clock, and the result lands in buf as fixed width fields in this format:
Fri Sep 13 00:00:00 1986\n\0
β οΈ okay listen, this matters: the result buffer buf must be at least 26 bytes long, and no attempt is made to check this. so if you skimp on the buffer, that's on you fr fr π
pmCtime returns buf as the value of the function. slay π
The default current reporting timezone is whatever's defined by the TZ environment variable, so at first pmCtime and ctime(3) will produce similar encoding of the date and time. twins, basically β¨
Wanna change it up? Use pmNewZone(3), pmNewContextZone(3) or pmUseZone(3) to establish a new current reporting timezone β and here's the iconic part: that will effect pmCtime but not ctime(3). main character energy only, no cap π
π SEE ALSO π
and that's the whole vibe, bestie π this one's brought to you by Performance Co-Pilot (the PCP girlies, you know who you are), and it's filed under PMCTIME(3). go format some timestamps, periodt ππΈ
π¦ 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) 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