1PMPARSECTIME(3)            Library Functions Manual            PMPARSECTIME(3)
2
3
4

NAME

6       __pmParseCtime - convert ctime(3) string to tm structure
7

C SYNOPSIS

9       #include "pmapi.h"
10       #include "libpcp.h"
11
12       int __pmParseCtime(const char *string, struct tm *rslt, char **errmsg);
13
14       cc ... -lpcp
15

CAVEAT

17       This  documentation is intended for internal Performance Co-Pilot (PCP)
18       developer use.
19
20       These interfaces are not part of the PCP APIs that  are  guaranteed  to
21       remain  fixed  across  releases,  and they may not work, or may provide
22       different semantics at some point in the future.
23

DESCRIPTION

25       __pmParseCtime reverses the asctime(3) function.  It accepts  a  string
26       specifying a time, and fills in the given tm structure.
27
28       string  is either a fully specified date and time in the format Day MMM
29       DD HH:MM:SS YYYY (e.g "Mon Mar  4 13:07:47 1996") or a partially speci‐
30       fied  date  and  time  like  "1996",  "Mar  1996", "Mar 4 1996", "Mar",
31       "13:07:47", "13:07", "Mar 4 13:07:47",....  For a  partially  specified
32       date  and  time,  the order of the fields must be preserved and missing
33       fields are filled in from the current date and time.
34
35       The seconds component (SS) may be a floating point number, for  example
36       the time "13:07:47.5".  The 12 hour clock is also supported, so "13:07"
37       and "1:07 pm" are equivalent.
38
39       __pmParseCtime returns 0 if successful.  It returns -1  and  a  dynami‐
40       cally  allocated  error  message  string in errmsg, if the given string
41       does not parse.  Be sure to free(3) the error message string.
42
43       The tm structure returned in rslt should only be used as an argument to
44       the  __pmConvertTime  function, as it contains encoded information that
45       will only be correctly interpreted by __pmConvertTime.
46

SEE ALSO

48       PMAPI(3), pmParseInterval(3), __pmConvertTime(3) and __pmParseTime(3).
49
50
51
52Performance Co-Pilot                  PCP                      PMPARSECTIME(3)
Impressum