logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

__pmParseCtime - convert ctime(3) string to tm structure

C Synopsis

#include"pmapi.h"#include"libpcp.h"int__pmParseCtime(constchar*string,structtm*rslt,char**errmsg);cc...-lpcp

Caveat

       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.

Description

__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 DayMMMDDHH:MM:SSYYYY (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 missing fields are 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.

       __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.

       The  tm structure returned in rslt should only be used as an argument to the __pmConvertTime function, as
       it contains encoded information that will only be correctly interpreted by __pmConvertTime.

Name

__pmParseCtime - convert ctime(3) string to tm structure

See Also

PMAPI(3), pmParseInterval(3), __pmConvertTime(3) and __pmParseTime(3).

Performance Co-Pilot                                   PCP                                       PMPARSECTIME(3)

See Also