<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=TIMEX</id>
	<title>TIMEX - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=TIMEX"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=TIMEX&amp;action=history"/>
	<updated>2026-04-11T09:09:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=TIMEX&amp;diff=842&amp;oldid=prev</id>
		<title>ConvertBot: perform various time transfer and conversion functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=TIMEX&amp;diff=842&amp;oldid=prev"/>
		<updated>2020-04-27T22:05:14Z</updated>

		<summary type="html">&lt;p&gt;perform various time transfer and conversion functions&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;perform various time transfer and conversion functions&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;in&amp;gt;           Input time specification&lt;br /&gt;
&amp;lt;out1...outn&amp;gt;  Output time specifications&lt;br /&gt;
&lt;br /&gt;
Keyword Only Parameters:&lt;br /&gt;
  [ROUND]  - See below for description&lt;br /&gt;
  [INFILE] - See below for description&lt;br /&gt;
  [INACQ]  - See below for description&lt;br /&gt;
  [INQUAD] - See below for description&lt;br /&gt;
&lt;br /&gt;
This intrinsic performs a number of time transformations with support for&lt;br /&gt;
multiple output formats in a single call.&lt;br /&gt;
&lt;br /&gt;
Input:&lt;br /&gt;
  The input time specifications are:&lt;br /&gt;
      NOW                   - the current system or CPU time (J1950)&lt;br /&gt;
      SSM                   - the seconds since midnight (this is similar to the&lt;br /&gt;
                              SECNDS() function in Fortran)&lt;br /&gt;
      DAY                   - the beginning of the current day&lt;br /&gt;
      &amp;lt;time&amp;gt;                - any valid time specifier:&lt;br /&gt;
                                o Time object&lt;br /&gt;
                                o &amp;quot;yyyy:mm:dd::hh:mm:ss&amp;quot;&lt;br /&gt;
                                o &amp;quot;&amp;lt;sec&amp;gt;&amp;quot;           (seconds since 01-JAN-1950)&lt;br /&gt;
                                o &amp;quot;(&amp;lt;sec&amp;gt;)&amp;quot;         (seconds since 01-JAN-1950)&lt;br /&gt;
                                o &amp;quot;(&amp;lt;wsec&amp;gt;,&amp;lt;fsec&amp;gt;)&amp;quot; (seconds since 01-JAN-1950)&lt;br /&gt;
                                o &amp;quot;&amp;lt;time string&amp;gt;&amp;quot;   (as specified by /INFMT=)&lt;br /&gt;
      ROUND=&amp;lt;seconds&amp;gt;       - round the output to the specified number of sec&lt;br /&gt;
      INFILE=&amp;lt;filename&amp;gt;     - the timecode field in a file&lt;br /&gt;
      INACQ=&amp;lt;filename&amp;gt;      - TBD (the ACQDATE/ACQTIME keywords in a file)&lt;br /&gt;
      INQUAD=&amp;lt;filename&amp;gt;     - the quadword epoch fields&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
  The output time specifications include (see nxm.sys.lib.Time for details):&lt;br /&gt;
      TERMINAL              - Displays time in the current terminal display&lt;br /&gt;
      &amp;lt;resname&amp;gt;             - Saves Time object in &amp;lt;resname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      FILE=&amp;lt;filename&amp;gt;       - Stores time in the timecode field of a BLUE file&lt;br /&gt;
      ACQ=&amp;lt;filename&amp;gt;        - TBD (the ACQDATE/ACQTIME keywords in a file)&lt;br /&gt;
      QUAD=&amp;lt;filename&amp;gt;       - Stores time in the quadword epoch fields of a&lt;br /&gt;
                              Type 5000 BLUE file (for ECR reference frame GHA)&lt;br /&gt;
&lt;br /&gt;
      YEAR=&amp;lt;resname&amp;gt;        - year (1950,...)&lt;br /&gt;
      MONTH=&amp;lt;resname&amp;gt;       - month of year (1..12)&lt;br /&gt;
      MONTHNAME=&amp;lt;resname&amp;gt;   - month of year (January,...)&lt;br /&gt;
      MONTHTRIGRAPH=&amp;lt;res&amp;gt;   - month of year (JAN,FEB,...)&lt;br /&gt;
      DAY=&amp;lt;resname&amp;gt;         - day of month (1..N)&lt;br /&gt;
      HOUR=&amp;lt;resname&amp;gt;        - hour of day (0..23)&lt;br /&gt;
      MINUTE=&amp;lt;resname&amp;gt;      - minute of hour (0..59)&lt;br /&gt;
      SECOND=&amp;lt;resname&amp;gt;      - second of minute (0..59)&lt;br /&gt;
      DAYOFWEEK=&amp;lt;resname&amp;gt;   - day of week (1=SUN,2=MON,...,7=SAT)&lt;br /&gt;
      DAYOFWEEKNAME=&amp;lt;res&amp;gt;   - day of week (Sunday,...)&lt;br /&gt;
      DAYOFWEEKTRIGRAPH=&amp;lt;r&amp;gt; - day of week (SUN,MON,...)&lt;br /&gt;
      JD=&amp;lt;resname&amp;gt;          - Julian day (or JUL=)&lt;br /&gt;
                              (NOTE: Julian Date Epoch is 12:00 1 Jan 4713BC)&lt;br /&gt;
      MJD=&amp;lt;resname&amp;gt;         - Midas Julian day (since J1950)&lt;br /&gt;
                              (NOTE: NOT the Modified Julian Day defined by SAO.&lt;br /&gt;
                               Modified Julian Day = Midas Julian Day + 33282.0)&lt;br /&gt;
      MJS=&amp;lt;resname&amp;gt;         - Midas Julian second (since J1950)&lt;br /&gt;
      SEC=&amp;lt;resname&amp;gt;         - seconds since 00:00 1 Jan 1950 (same as MJS)&lt;br /&gt;
      YIS=&amp;lt;resname&amp;gt;         - year in seconds&lt;br /&gt;
      DOY=&amp;lt;resname&amp;gt;         - day of year (0..364/365)&lt;br /&gt;
      SOY=&amp;lt;resname&amp;gt;         - seconds of year&lt;br /&gt;
      SOD=&amp;lt;resname&amp;gt;         - seconds of day&lt;br /&gt;
      FOD=&amp;lt;resname&amp;gt;         - fraction of day (0.0 to 1.0)&lt;br /&gt;
      GHA=&amp;lt;resname&amp;gt;         - Greenwich hour angle (in radians)&lt;br /&gt;
      WSEC=&amp;lt;resname&amp;gt;        - Whole Seconds since J1950&lt;br /&gt;
      FSEC=&amp;lt;resname&amp;gt;        - Fractional Seconds since J1950&lt;br /&gt;
      LEAPYEAR=&amp;lt;resname&amp;gt;    - Indicates if it is a leap year (true/false)&lt;br /&gt;
&lt;br /&gt;
Rounding:&lt;br /&gt;
  The input time can be rounded to a desired precision before output processing&lt;br /&gt;
  via the ROUND=&amp;lt;precision&amp;gt; parameter. This parameter causes the input time to&lt;br /&gt;
  be rounded to the nearest &amp;lt;precision&amp;gt; seconds. For example: ROUND=1 rounds to&lt;br /&gt;
  nearest second, ROUND=1:00:00 to the nearest hour, and ROUND=1e-3 rounds to&lt;br /&gt;
  the nearest millisecond.  Restrictions: precision must be an integer number&lt;br /&gt;
  of seconds or divide evenly into 1 second.&lt;br /&gt;
&lt;br /&gt;
Formatting:&lt;br /&gt;
  Since NeXtMidas 2.5.0 the TIMEX command supports a wide variety of time/date&lt;br /&gt;
  formats made available via the MFormat class. Acceptable in/out formats can&lt;br /&gt;
  be either a standard Midas format:&lt;br /&gt;
   Type       Format                       Example (1993-FEB-25 14:42:57.123456)&lt;br /&gt;
   -----------------------------------------------------------------------------&lt;br /&gt;
   &amp;quot;STD&amp;quot;      yyyy:MM:dd::HH:mm:ss[.SSS]   1993:02:25::14:42:57.123456&lt;br /&gt;
              T:yyyy:MM:dd::HH:mm:ss[.SSS] T:1993:03:25::14:42:57.123&lt;br /&gt;
   &amp;quot;ACQ&amp;quot;      [yy]yy.DDD:HH:mm:ss[.SSS]    93.056:14:42:57.123456&lt;br /&gt;
   &amp;quot;EPOCH&amp;quot;    yyyy:sec_in_year             1993:4804977.123456&lt;br /&gt;
   &amp;quot;FILENAME&amp;quot; yyyyMMdd_HHmmss[SSS]         19930225_144257123456&lt;br /&gt;
   &amp;quot;NORAD&amp;quot;    yyDDD.frac_of_day            93056.61316115&lt;br /&gt;
   &amp;quot;TCR&amp;quot;      D:HH:mm:ss.SSS               56:14:42:57.123456&lt;br /&gt;
   &amp;quot;VAX&amp;quot;      dd-MMM-yyyy:HH:mm:ss.SSS     25-FEB-1993:14:42:57.123456&lt;br /&gt;
   &amp;quot;HMS&amp;quot;      HH:mm:ss.SSS                 14:42:57.123456&lt;br /&gt;
   &amp;quot;YMD&amp;quot;      yyyy:MM:dd                   1993:02:25&lt;br /&gt;
   &amp;quot;ISO8601&amp;quot;  yyyy-MM-ddTHH:mm:ss.SSSZ     1993-02-25T14:42:57.123456Z&lt;br /&gt;
   &amp;quot;FULL_STD&amp;quot; yyyy:MM:dd::HH:mm:ss.SSS     1993:02:25::14:42:57.123456&lt;br /&gt;
&lt;br /&gt;
  Or they can be any of the patterns accepted by the java.text.SimpleDateFormat.&lt;br /&gt;
  This gives maximum flexibility when converting between various time/date&lt;br /&gt;
  formats. Here is mini-guide to above format/SimpleDateFormat pattern letters:&lt;br /&gt;
    D=Day in year (1-366),  d=Day in month (1-31),   M=Month in year (1-12),&lt;br /&gt;
    H=Hour in day (0-23),   h=Hour in am/pm (1-12),  m=Minute in hour (0-59),&lt;br /&gt;
    s=whole seconds in minute (0-59), S=fractional seconds (up to femtosecond),&lt;br /&gt;
    (NOTE: above doc difference vs S for milliseconds in SimpleDateFormat).&lt;br /&gt;
&lt;br /&gt;
  Note: When the time is one day or less, time formats STD, ACQ, EPOCH, and VAX&lt;br /&gt;
  do NOT output the year, month, and day, but only the hours, minutes, and&lt;br /&gt;
  seconds. ISO8601 time format in NeXtMidas 3.3.0 to 3.5.3 also had this&lt;br /&gt;
  behavior, but was change to always output full date and time in 3.5.4.&lt;br /&gt;
&lt;br /&gt;
  For details, please see nxm.sys.lib.MFormat, nxm.sys.lib.Time.formatList and&lt;br /&gt;
  java.text.SimpleDateFormat.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
  1. Display the current time at the terminal.&lt;br /&gt;
       nM&amp;gt; TIMEX&lt;br /&gt;
       Time = 2004:05:09::16:04:53.416&lt;br /&gt;
     or&lt;br /&gt;
       nM&amp;gt; TIMEX NOW terminal&lt;br /&gt;
       Time = 2004:05:09::16:04:53.416&lt;br /&gt;
&lt;br /&gt;
  2. Display the current time rounded to the nearest second.&lt;br /&gt;
       nM&amp;gt; TIMEX round=1 terminal&lt;br /&gt;
       Time = 2004:05:09::16:04:53.000&lt;br /&gt;
&lt;br /&gt;
  3. Writes the current system time to the epoch timecode fields of MYFILE&lt;br /&gt;
     and also to the result LOCALTIME.&lt;br /&gt;
       nM&amp;gt; TIMEX NOW file=myfile localtime&lt;br /&gt;
&lt;br /&gt;
  4. Copies the epoch timecode in MYFILE to the epoch timecode in YOURFILE&lt;br /&gt;
     and the YOUROTHERFILEs acquisition fields.&lt;br /&gt;
       nM&amp;gt; TIMEX infile=myfile file=yourfile acq=yourotherfile&lt;br /&gt;
&lt;br /&gt;
  5. Breaks out the acquisition date/time keywords for MYFILE into its&lt;br /&gt;
     Julian day components for system modeling functions.&lt;br /&gt;
       nM&amp;gt; TIMEX acq=myfile jd=julianday soy=secofyear gha=greenwichHourAngle&lt;br /&gt;
&lt;br /&gt;
  6. Uses the timecode field in MYFILE as the quadword epoch time for&lt;br /&gt;
     the ECI reference frame.  This affects the epoch_year, epoch_seconds,&lt;br /&gt;
     and epoch_hour_angle quadwords of the file, quadwords(10-12).&lt;br /&gt;
       nM&amp;gt; TIMEX file=myfile quad=myfile&lt;br /&gt;
&lt;br /&gt;
     (There are no restrictions on the number of output parameters.)&lt;br /&gt;
&lt;br /&gt;
  7. Converts a time string to a DOUBLE.&lt;br /&gt;
       nM&amp;gt; timex &amp;quot;2004:11:15::13:55:31.503&amp;quot; d:mytime&lt;br /&gt;
       nM&amp;gt; res mytime&lt;br /&gt;
         D: MYTIME          = 1.731678931503E9&lt;br /&gt;
&lt;br /&gt;
     Could also use (note this only works when the time is not quoted):&lt;br /&gt;
       nM&amp;gt; res d:mytime 2004:11:15::13:55:31.503&lt;br /&gt;
       nM&amp;gt; res mytime&lt;br /&gt;
         D: MYTIME          = 1.731678931503E9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  8. Converts a time string to a long LONG.&lt;br /&gt;
       nM&amp;gt; timex &amp;quot;2004:11:15::13:55:31.503&amp;quot; L:mytime&lt;br /&gt;
       nM&amp;gt; res mytime&lt;br /&gt;
         L: MYTIME          = 1731678932&lt;br /&gt;
&lt;br /&gt;
     Could also use (note this only works when the time is not quoted):&lt;br /&gt;
       nM&amp;gt; res d:mytime 2004:11:15::13:55:31.503&lt;br /&gt;
       nM&amp;gt; res mytime&lt;br /&gt;
         L: MYTIME          = 1731678931&lt;br /&gt;
&lt;br /&gt;
     Note that TIMEX will round the time to the nearest second while RESULT&lt;br /&gt;
     will always do a type cast (i.e. round down).&lt;br /&gt;
&lt;br /&gt;
  9. Use Java input and output formats (since NeXtMidas 2.5.0).&lt;br /&gt;
       nM&amp;gt; timex now /fmt=&amp;quot;yyyy-MM-dd hh:mm:ss.SSS&amp;quot;&lt;br /&gt;
       Time = 2007-08-06 10:30:14.745&lt;br /&gt;
&lt;br /&gt;
       nM&amp;gt; timex &amp;quot;2007-08-06 10:30:14.745&amp;quot; /infmt=&amp;quot;yyyy-MM-dd hh:mm:ss.SSS&amp;quot;&lt;br /&gt;
       Time = 2007:08:06::10:30:14.745&lt;br /&gt;
&lt;br /&gt;
       nM&amp;gt; timex &amp;quot;1994-01-01T00:00:00Z&amp;quot; /infmt=&amp;quot;yyyy-MM-dd'T'hh:mm:ss'Z'&amp;quot;&lt;br /&gt;
       Time = 1994:01:01::00:00:00&lt;br /&gt;
&lt;br /&gt;
       nM&amp;gt; timex &amp;quot;1994-01-01T00:00:00Z&amp;quot; /infmt=&amp;quot;ISO8601&amp;quot;  !since NeXtMidas 3.3.0&lt;br /&gt;
       Time = 1994:01:01::00:00:00&lt;br /&gt;
&lt;br /&gt;
  10. Get current time in Hour-Min-Sec time format into results TIMEHMS.&lt;br /&gt;
       nM&amp;gt; timex now timeHMS /fmt=&amp;quot;HMS&amp;quot;&lt;br /&gt;
       nM&amp;gt; res timeHMS&lt;br /&gt;
       12S: TIMEHMS         = 17:44:27.293&lt;br /&gt;
&lt;br /&gt;
  11. Comparison of time of day (since midnight) in STD versus FULL_STD&lt;br /&gt;
       nM&amp;gt; TIMEX SSM /fmt=&amp;quot;STD&amp;quot;&lt;br /&gt;
       Time = 19:56:12.337&lt;br /&gt;
       nM&amp;gt; TIMEX SSM /fmt=&amp;quot;FULL_STD&amp;quot;                     !since NeXtMidas 3.5.2&lt;br /&gt;
       Time = 1950:01:01::19:56:12.337&lt;br /&gt;
&lt;br /&gt;
  12. Up to femtosecond precision is available           !since NeXtMidas 3.5.2&lt;br /&gt;
       nM&amp;gt; timex &amp;quot;2014:04:03  02:34:56.123456789012345&amp;quot; &amp;amp;&lt;br /&gt;
             /infmt=&amp;quot;yyyy:MM:dd  hh:mm:ss.SSSSSSSSSSSSSSS&amp;quot; &amp;amp;&lt;br /&gt;
             /fmt=&amp;quot;d MMM yyyy HH:mm:ss.SSSSSSSSSSSSSSSSSS&amp;quot;&lt;br /&gt;
       Time = 3 Apr 2014 02:34:56.123456789012345&lt;br /&gt;
&lt;br /&gt;
  13. simpleDateFormat milliseconds used when 3 or less Ss are specified&lt;br /&gt;
        nM&amp;gt;  timex &amp;quot;2014:04:03::02:34:56.1234&amp;quot; /fmt=&amp;quot;d MMM yyyy HH:mm:ss.S&amp;quot;&lt;br /&gt;
        Time = 3 Apr 2014 02:34:56.123&lt;br /&gt;
&lt;br /&gt;
  14. T:&amp;lt;std_format&amp;gt; as STD Time&lt;br /&gt;
        nM&amp;gt; timex T:2015:03:14::09:26:53.589793238462 /PREC=12&lt;br /&gt;
        Time = 2015:03:14::09:26:53.589793238462&lt;br /&gt;
&lt;br /&gt;
Switches:&lt;br /&gt;
  /FMT=&amp;lt;str&amp;gt;    Output format to use. If present, the output is a formatted&lt;br /&gt;
                time/data string, otherwise it will be a Time object. See the&lt;br /&gt;
                above section titled &amp;quot;Formatting&amp;quot; for details.&lt;br /&gt;
  /INFMT=&amp;lt;str&amp;gt;  Input format to use. If present, the input value is parsed from&lt;br /&gt;
                a time/data string, otherwise it will assume one of the time&lt;br /&gt;
                specifiers listed above. See the &amp;quot;Formatting&amp;quot; section for&lt;br /&gt;
                details.&lt;br /&gt;
  /PREC=&amp;lt;n&amp;gt;     Number of places after the decimal point to display when given&lt;br /&gt;
                one of the &amp;quot;standard&amp;quot; formats on the /FMT= switch.&lt;br /&gt;
&lt;br /&gt;
See Also: nxm.sys.lib.Time, nxm.sys.lib.MFormat&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>