>  Docs Center  >  Libraries  >  JHU/APL/S1R  >  DT_TM_TOJS






      Convert a date/time string to "Julian Seconds".


Calling Sequence

      js = dt_tm_tojs( dt)


      dt = date/time string (may be array). in
            (see date2ymd for format)

Keyword Parameters


        Use one of these keywords if all numeric:
        /YMD Date is all numeric: Year, Month, Day
        /YDM Date is all numeric: Year, Day, Year
        /DMY Date is all numeric: Day, Month, Year
        /MDY Date is all numeric: Month, Day, Year
        /YDN Date is all numeric: Year, Day of year
        /DNY Date is all numeric: Day of year, Year
        FORMAT=fmt Specify format of input.
          A format may be needed to indicate date and time. Use
          the letters y,n,d in the same positions as year, month
          and day or y and # for year and day number in the input
          string, and the pairs hh, mm, and ss[s...] for hour,
          minute, second (the s format must include any decimal
          point and places) Any other char may be used as
          place holders. Case is ignored. Examples:
            for txt='gs_06oct09_0208_multi.png' use
            for txt='gs_20101600208_multi.png' use
            for txt='OCF_20110930T171924.430136' use
          If s and/or m are not used they default to 0.
          Trailing placeholders are not really needed.
          >>>===> Make sure to use n for month (m is for minute).
          May also use with the all numeric keywords if needed.
          All input strings must have the same format to use this.
          Times given with no colons must use a format.
        BASE=base Use to convert 2-digit years to 4-digit years.
          If 2-digit year is not close to the current year then
          give in base a year close to the years to convert.
        ERROR=err Error flag: 0=ok, else error.
        /QUIET means inhibit error message.


      js = "Julian Seconds". out

Common Blocks


      Notes: Julian seconds (not an official unit) serve the
        same purpose as Julian Days, interval computations.
        The zero point is 0:00 1 Jan 2000, so js < 0 before then.
        Julian Seconds are double precision and have a precision
        better than 1 millisecond over a span of +/- 1000 years.
        2 digit years (like 17 or 92) are changed to the closest
        corresponding 4 digit year.
      See also dt_tm_fromjs, ymds2js, js2ymds, jscheck.

Modification History

      R. Sterner, 23 Jul, 1992
      R. Sterner, 1994 Mar 29 --- Modified to handle arrays.
      R. Sterner, 1999 aug 04 --- Improved 2 digit year case.
      R. Sterner, 2000 aug 17 --- Added /QUIET
      R. Sterner, 2005 Jan 02 --- Allowed numeric dates.
      R. Sterner, 2006 Nov 09 --- Added FORMAT=fmt.
      R. Sterner, 2008 Aug 06 --- Passed QUIET in to yy2yyyy.
      R. Sterner, 2009 May 14 --- Handled time correctly if given a format.
      R. Sterner, 2009 May 14 --- Added keyword BASE=base.
      R. Sterner, 2010 Apr 29 --- Converted arrays from () to [].
      R. Sterner, 2010 Jun 17 --- Now can handle day of year.
      R. Sterner, 2010 Sep 17 --- Now gets any fractional part of seconds.
      R. Sterner, 2012 Apr 18 --- Formatted seconds now double (was float).
      R. Sterner, 2012 Apr 18 --- Corrected help text for s format.
      R. Sterner, 2012 Nov 29 --- Added /BOUND keyword.
  Copyright (C) 1992, 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.

© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us