NAME | C SYNOPSIS | CAVEAT | DESCRIPTION | SEE ALSO | COLOPHON |
|
|
PMPARSECTIME(3) Library Functions Manual PMPARSECTIME(3)
__pmParseCtime - convert ctime(3) string to tm structure
#include "pmapi.h" #include "libpcp.h" int __pmParseCtime(const char *string, struct tm *rslt, char **errmsg); cc ... -lpcp
This documentation is intended for internal Performance Co-Pilot (PCP) developer use. 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.
__pmParseCtime reverses the asctime(3) function. It accepts a string specifying a time, and fills in the given tm structure. 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 par‐ tially 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 missing fields are filled in from the current date and time. The seconds component (SS) may be a floating point number, for ex‐ ample the time "13:07:47.5". The 12 hour clock is also supported, so "13:07" and "1:07 pm" are equivalent. __pmParseCtime returns 0 if successful. It returns -1 and a dy‐ namically allocated error message string in errmsg, if the given string does not parse. Be sure to free(3) the error message string. The tm structure returned in rslt should only be used as an argu‐ ment to either the __pmtimevalConvert function or the __pmtime‐ specConvert function, as it contains encoded information that will only be correctly interpreted by these routines.
PMAPI(3), __pmtimespecConvert(3), __pmtimevalConvert(3), __pmtime‐ specParse(3) __pmtimevalParse(3) and pmParseInterval(3).
This page is part of the PCP (Performance Co-Pilot) project. In‐
formation about the project can be found at ⟨http://www.pcp.io/⟩.
If you have a bug report for this manual page, send it to
pcp@groups.io. This page was obtained from the project's upstream
Git repository ⟨https://github.com/performancecopilot/pcp.git⟩ on
2025-08-11. (At that time, the date of the most recent commit
that was found in the repository was 2025-08-11.) If you discover
any rendering problems in this HTML version of the page, or you
believe there is a better or more up-to-date source for the page,
or you have corrections or improvements to the information in this
COLOPHON (which is not part of the original manual page), send a
mail to man-pages@man7.org
Performance Co-Pilot PCP PMPARSECTIME(3)
Pages that refer to this page: __pmconverttime(3), __pmparsetime(3)