PMLOCALTIME(3)
π PMLOCALTIME(3) π
okay bestie, welcome to the Library Functions Manual corner of the PCP-verse β¨ this one's short, sweet, and honestly kind of iconic.
πΈ NAME πΈ
pmLocaltime β convert the date and time for a reporting timezone π°οΈ
β¨ C SYNOPSIS β¨
#include <time.h>
#include <pcp/pmapi.h>
struct tm *pmLocaltime(const time_t *clock, struct tm *result);
cc ... -lpcp
π¦ DESCRIPTION π¦
so pmLocaltime is basically localtime(3)'s cooler cousin π
it does the same lil job, but there are two major glow-ups:
- the timezone it uses is the current "reporting timezone", not the default
TZenvironment variable scheme, and - the result gets written into a buffer you declare, not some private buffer it keeps to itself π
like localtime(3), the time you wanna convert gets passed in through clock, and the result you get back has all the components broken out into the elements of the tm struct π
pmLocaltime returns result as the value of the function. periodt.
the default current reporting timezone is whatever the TZ environment variable defines, so at first pmLocaltime and localtime(3) will produce a similar encoding of the date and time. twin behavior, no cap π
now for the main character move: use pmNewZone(3), pmNewContextZone(3) or pmUseZone(3) to establish a new current reporting timezone. that new zone will affect pmLocaltime but not localtime(3) π
π«Ά SEE ALSO π«Ά
localtime(3)PMAPI(3)pmCtime(3)pmGetConfig(3)pmNewContextZone(3)pmNewZone(3)pmUseZone(3)pcp.conf(5)pcp.env(5)
and that's the whole page, bestie, you ate it π this was Performance Co-Pilot (aka PCP) dropping PMLOCALTIME(3) β go forth and convert your timestamps responsibly, mwah ππ
π¦ 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 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