[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
WFDB_Time strtim(char *string) |
This function converts an ASCII string in standard time format to a time in units of sample intervals. Examples of standard time format:
2:14.875
[13:6:0]
[8:0:0 1]
[12:0:0 1/3/1992]
143
4:02:01
s12345
c350.5
e
i
o
If the argument is bracketed (as in the second, third, and fourth examples), it
is taken as a time of day, and strtim
uses the base time defined
by the header file or by the caller
(see section setbasetime);
in this case, the value returned is zero or negative (and can be
converted into elapsed time from the beginning of the record by simply
negating it). If the argument is not bracketed, it is taken as a time
interval, and converted directly into a positive number of sample
intervals. These notations match those used by timstr
and
mstimstr
, which are (approximately) inverse functions of
strtim
; in fact, for MIT DB and AHA DB records (and any others
with sampling frequencies below 1 KHz), strtim(mstimstr(t))
= t, for any t. The `s'-format (as in the seventh
example above) is provided to allow "conversion" of time intervals
already expressed in sample intervals. The similar `c'-format
converts counter values
(see section getcfreq)
into sample intervals. The length of the record in
sample intervals can be obtained using strtim("e")
, which
evaluates to zero if this quantity is undefined. The sample number of
the next sample to be read or written can be determined using
strtim("i")
or strtim("o")
. If the argument string is
incorrectly formatted, strtim
returns zero (indistinguishable
from a correct input that evokes a zero output); this may be considered
a feature. Several of the programs in chapter 6 illustrate the use of
strtim
(for example, see section Example 7: A General-Purpose FIR Filter).
The next two functions convert between Julian dates and ASCII strings. Julian dates as defined by astronomers begin at noon GMT; these begin at midnight local time.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |