// STEREOSecs.h // // Originated and maintained by // // Tycho von Rosenvinge // Laboratory for High Energy Astrophysics // NASA/Goddard Space Flight Center // Greenbelt, MD 20771 // // Tel. 301-286-6721 // e-mail tycho@milkyway.gsfc.nasa.gov // STEREOSecs is a subset of STEREOtime which converts seconds of 1958 to a date and time string // or vice versa // 24 hour clock // STEREO keeps time as seconds since 1958 Jan 1 00:00:00 // 1958 Jan 1 = day of year #1 (not 0!) extern long ts_sec58(char *str, char **end); // Scan date/time string to obtain seconds of 1958; // string in [YY]YY Mon DD HH[:]MM[:][SS] format, // where [] imply optional parameters; // // [YY]YY DecimalDoy also works (e.g. 1998 33.5 = 1998 Feb 2 12:00) // [YY]YY/MM/DD HH[:]MM[:][SS] also works. // [YY]YY DOY HH[:]MM[:][SS] also works // // // e.g. 00 Nov 1 0410 is recognised as 2000 Nov 1 04:10:00 // // Note: time string is ordered by descending time // duration: year .... seconds // // ts_sec58() returns pointer to the point after the time // scanned (a useful feature if there is another time // to scan e.g., when you have a start and end date/time // in one string); you must supply a proper char **end // argument even if you aren't going to use this feature // since the routine will set *end to equal a pointer // value extern void sec58_ts(long sec58,char *ts); // builds time string ts from seconds of 1996 // e.g. seconds of 1958 = 0 gives 1958 Jan 1 00:00:00