PMPARSECTIME(3) Library Functions Manual PMPARSECTIME(3)NAME
__pmParseCtime - convert ctime(3) string to tm structure
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/impl.h>
int __pmParseCtime(const char *string, struct tm *rslt, char **errmsg);
cc ... -lpcp
DESCRIPTION
__pmParseCtime reverses the asctime(3C) function. It accepts a string specifying a time, and fills in the given tm structure.
Either a fully specified asctime(3C) string like "Mon Mar 4 13:07:47 1996" or a partially specified time like '1996", "Mar 1996", "Mar 4
1996", "Mar", "13:07:47", "13:07", "Mar 4 13:07:47",... is accepted. In addition, the seconds component may be a floating point number,
for example "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(3C) 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.
SEE ALSO PMAPI(3), pmParseInterval(3), __pmConvertTime(3) and __pmParseTime(3).
Performance Co-Pilot PCP PMPARSECTIME(3)
Check Out this Related Man Page
PMPARSETIME(3) Library Functions Manual PMPARSETIME(3)NAME
__pmParseTime - parse time point specification
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/impl.h>
int __pmParseTime(const char *string, struct timeval *logStart, struct timeval *logEnd, struct timeval *rslt, char **errMsg);
cc ... -lpcp
DESCRIPTION
__pmParseTime is designed to encapsulate the interpretation of a time point specification in command line switches for use by the PCP
client tools.
This function expects to be called with the time point specification as string. If the tool is running against PCP archive(s), you also
need to supply the start time of the first (only) archive as logStart, and the end of the last (only) archive as logEnd. See pmGetArchive-
Label(3) and pmGetArchiveEnd(3) for how to obtain values for these parameters. If the tool is running against a live feed of performance
data, logStart should be the current time (but could be aligned on the next second for example), while logEnd should have its tv_sec compo-
nent set to INT_MAX.
The rslt structure must be allocated before calling __pmParseTime.
You also need to set the current PCP reporting time zone to correctly reflect the -z and -Z command line parameters before calling __pm-
ParseTime. See pmUseZone(3) and friends for information on how this is done.
If the conversion is successful, __pmParseTime returns 0, and fills in rslt with the time value defined by the input parameters. If the
argument strings could not be parsed, it returns -1 and a dynamically allocated error message string in errMsg. Be sure to free(3C) this
error message string.
SEE ALSO PMAPI(3), pmGetArchiveEnd(3), pmGetArchiveLabel(3), pmNewContextZone(3), pmNewZone(3), pmParseInterval(3), pmParseTimeWindow(3), pmUse-
Zone(3), __pmConvertTime(3) and __pmParseCtime(3).
Performance Co-Pilot PCP PMPARSETIME(3)
Hi,
How to strip a portion of a file name from behind...Say for Eg..i have a file name like aaaaa.bbbbb.Mar-17-2007
i want to remove .Mar-17-2007...is there a one line command which can give this output...
Thanks
Kumar (5 Replies)
I am working on a file with specific timestamps.
I want to delete all the lines above the timestamp 18:31. I tried using the following command but it deleted 18:31 also.
sed '1,/18:/d' <file-name>
Some quick help will be appreciated !!!!!! :) (9 Replies)
I want to print the current and next line of "Mar 02" in the file.
Input
Mon Mar 02 11:07:02 2009
ABC
Tue Mar 03 11:02:20 2010
Wrong data
Mon Mar 02 11:07:02 2009
XYZ
Mon Mar 02 11:07:08 2010
124
Mon Mar 02 11:07:08 2010
1400
Output
Mon Mar 02 11:07:02 2009
ABC
Mon Mar 02... (6 Replies)
Hello,
I have a series of logs that I need to analyse.
each looks something like:234.10.72.175 Mon Mar 02 20:25:00 GMT 2009
226.91.87.86 Thu Mar 05 03:50:26 GMT 2009
226.91.87.86 Thu Mar 05 04:06:07 GMT 2009
Using awk, so far I have been able to count the lines in a... (5 Replies)
Hi All,
Can anyone give me the command to copy files from 03-Mar-2013 to 07-Mar-2013 in folder.
there are nearly 40+ thousand files in directory , so I just need files from Mar 3rd to Mar 7th and copy them to a location .
Need quick help pls (2 Replies)