#include <cogent.h>
ST_STATUS LG_Time(IP_Task* myself, IP_Task* textlog, char* retbuf, int buflen, char* timespec, int nlabels, char** labels );
A time specification format string, whose options are as follows:
| %J | The day of the week (e.g., Mon). |
| %j | The day of the month [1-31]. |
| %M | The month (e.g., Jan). |
| %m | The month in the year [1-12]. |
| %y | The year in the century (e.g., 96). |
| %Y | The year with century (e.g., 1996). |
| %h | The hour in the day [0-23]. |
| %n | The minute in the hour [0-59]. |
| %z | The second in the minute [0-59]. |
| %Z | The seconds since Jan 1, 1970. |
| %T | The tenths of seconds in second (%z). |
| %H | The hundredths of seconds in second (%z). |
| %L | The milliseconds in second (%z). |
| %U | The microseconds in second (%z). |
| %N | The nanoseconds in second (%z). |
| %A | Sets a global default time spec. This default can be changed at any time, including run-time. |
ST_OK on success. Otherwise ST_ERROR, and the retbuf will contain a more detailed error message (see time in the Cascade TextLogger documentation). If the return value is ST_OK, the retbuf may not contain useful information.
This function lets you specify the time format for any log or group. If no labels are specified, this command sets a global default value for all logs and groups. Any specific value always overrides the global definition, regardless of the order in the configuration file or when a command is sent.
You can prepend any printf-style format modifiers to the time spec field names, as appropriate for the field type. Some of these format modifiers will be ignored (e.g., %y and %Y ignore format modifiers). The string-type fields, %J and %M, respond to %s modifiers.
![]() | Sub-second fields (%T, %L, %U, %N) usually need to be zero-padded to produce readable results, as in %z.%09N. |
This function corresponds to the Cascade TextLogger time command.
Copyright © 1995-2012 by Cogent Real-Time Systems, Inc. All rights reserved.