PMPARSECTIME(3)
π NAME π
__pmParseCtime β bestie, this one takes a ctime(3) string and turns it into a tm structure β¨
This page lives in the PMPARSECTIME(3) chapter of the Library Functions Manual, iykyk π
πΈ C SYNOPSIS πΈ
#include "pmapi.h"
#include "libpcp.h"
int __pmParseCtime(const char *string, struct tm *rslt, char **errmsg);
cc ... -lpcp
π¨ CAVEAT π¨
Okay so listen, this documentation is for internal Performance Co-Pilot (PCP) developer use only, fr fr.
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 on them, bestie π
β¨ DESCRIPTION β¨
__pmParseCtime is literally the reverse of the asctime(3) function. It accepts a string specifying a time, and fills in the given tm structure. No cap π«Ά
string is either:
- a fully specified date and time in the format
Day MMM DD HH:MM:SS YYYY(e.g."Mon Mar 4 13:07:47 1996"), or - a partially specified date and time, like
"1996","Mar 1996","Mar 4 1996","Mar","13:07:47","13:07","Mar 4 13:07:47", ....
For a partially specified date and time, the order of the fields must be preserved and the missing fields get filled in from the current date and time π°οΈβ¨
The seconds component (SS) may be a floating point number, for example the time "13:07:47.5" π The 12 hour clock is also supported, so "13:07" and "1:07 pm" are equivalent. Iconic behaviour honestly π
__pmParseCtime returns 0 if successful. It returns -1 and a dynamically allocated error message string in errmsg if the given string does not parse. Be sure to free(3) the error message string, or you will leak, and we don't do that π
β οΈ Thetmstructure returned inrsltshould only be used as an argument to either the__pmtimevalConvertfunction or the__pmtimespecConvertfunction, as it contains encoded information that will only be correctly interpreted by these routines. Do not freestyle with it, bestie, it will not go well π
π SEE ALSO π
PMAPI(3), __pmtimespecConvert(3), __pmtimevalConvert(3), __pmtimespecParse(3) __pmtimevalParse(3) and pmParseInterval(3) π
And that's the whole vibe, babes π¦ β this page came to you straight out of Performance Co-Pilot (PCP), and the page you're reading is PMPARSECTIME(3). Go parse some timestamps, you absolute main character ππ
π¦ 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