PMMKTIME(3)

πŸ“¦
version 7.2.2 Β· 4 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMMKTIME(3) β€” Library Functions Manual πŸ’–

okay bestie, we're deep in the PCP (Performance Co-Pilot) docs rn, this is page PMMKTIME(3), and it's giving ✨internal tooling✨ energy. stay with me, it's short and cute.


🌸 NAME 🌸

__pmMktime β€” convert a tm structure to a calendar time πŸ•°οΈ


✨ C SYNOPSIS ✨

#include <time.h>
#include "pmapi.h"
#include "libpcp.h"

time_t __pmMktime(struct tm *timeptr);

cc ... -lpcp

like yes, you include all three headers, yes you link -lpcp, no we are not skipping any of it πŸ’…


⚠️ CAVEAT ⚠️

fr fr, read this one before you get attached:

  • this whole doc is meant for internal Performance Co-Pilot (PCP) developer use only, it's not for the general public, bestie πŸ™ˆ
  • 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… no cap, this could change under you at any moment. don't build your whole personality on it.

πŸ’… DESCRIPTION πŸ’…

__pmMktime is basically mktime(3)'s twin, lowkey. Very similar, except the timezone it uses is the current reporting timezone β€” not the default TZ environment variable scheme. that's the whole plot twist πŸŽ€

and just like mktime(3):

  • the time you want converted gets passed in via timeptr 🫢
  • the function result holds the calendar time, aka the number of seconds since 00:00:00 UTC, January 1, 1970 ⏳

the default current reporting timezone is whatever the TZ environment variable defines, so at first __pmMktime and mktime(3) will produce similar conversions. they start out matching, it's cute 🌸

then, when you want to switch it up, use pmNewZone(3), pmNewContextZone(3) or pmUseZone(3) to establish a new current reporting timezone. heads up though, that new zone will effect __pmMktime but not mktime(3). so they'll diverge, and that's on purpose, periodt πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the page, bestie!! this one came out of the Performance Co-Pilot world, tagged PCP, filed under PMMKTIME(3) πŸŽ€ go read mktime(3) next if you want the normie version, ily, slay πŸ’–βœ¨

πŸ“¦ where this page comes from