SECSTR Name
SECSTR Purpose
Convert a time string to seconds. Category
Calling Sequence
s = secstr(tstr) Inputs
tstr = time string. in
Scalar or string array.
Keyword Parameters
Keywords
ERROR=err Error flag: 0=ok, 1=did not understand time.
Outputs
s = seconds after midnight. out
Common Blocks
Notes
Note: time string must have the following format:
[DDD/]hh:[mm[:ss[:nnn/ddd]]]
where hh=hours, mm=minutes, ss=seconds, DDD=days,
nnn/ddd=a fraction.
A special case with no colons also allowed:
174636 (17:46:36) or 1746 (17:46). No days allowed.
Examples: 12:, 12:34, 12:34:10, 2/12:34:10,
2/12:34:10:53/60, 12:34:10:53/60
Modification History
Written R. Sterner, 10 Jan, 1985.
Johns Hopkins University Applied Physics Laboratory.
Added day: 21 Feb, 1985.
Added negative time: 16 Apr, 1985.
RES 18 Sep, 1989 --- converted to SUN.
R. Sterner 2 Jan, 1990 --- allowed arrays.
R. Sterner 2 Nov, 1992 --- Handled null srtings.
R. Sterner, 27 Jan, 1993 --- dropped reference to array.
R. Sterner 9 Feb, 1993 --- Fixed to handle correctly both arrays
and null strings.
R. Sterner, 12 Feb, 1993 --- returned 1 element arrays as a scalar.
R. Sterner, 2001 Jul 23 --- Added no colon time format case.
R. Sterner, 2007 Jan 04 --- Made loop index long.
R. Sterner, 2008 Aug 18 --- Added error checking.
R. Sterner, 2009 May 14 --- Allowed just hours: 00, 12, 18, ...
R. Sterner, 2010 Apr 29 --- Converted arrays from () to [].
R. Sterner, 2010 Sep 17 --- Now allows fractions of sec for colon case.
Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.