1 Time

  Use the `SET X MODE DATE' or `SET X MODE TIME' commands to plot
  things as  a function of date or time. For the date the day will be
  printed as the scale and the month will be shown below the scale.

  Note that the command `SET X MODE DATE|TIME' has more effect than
  the usual `INTEGER, REAL' or `LOG' modes. If `DATE|TIME' mode is
  selected plot limits must also be given as a date or time. If you
  project an Ntuple, then the x-axis is also assumed to be in date or
  time mode.

  See HELP Y2K for details on how I cope with the 21st century in
  Mn_Fit. In general years less than 80 are assumed to be in the 21st
  century. Mn_Fit can only cope with 2 digit years, i.e. 99 or 02. If
  you have a date in an Ntuple stored as YYYYMMDD single precision
  is not sufficient to reliably get the month and day correct.

  It is possible to make plots as a function of date and/or time. The
  easiest way to read in and store something as a function of time is
  to use the `DAT_FETCH' command or to store the data in an Ntuple and
  then use one of the date/time functions. The time can be given in a
  number of different forms:

  DATE_TIM     YYMMDD HHMMSS
  DATE         YYMMDD
  TIME         HHMMSS
  DATE_MIN     YYMMDD HHMM
  TIME_MIN     HHMM
  VAXTIME      Char*23 Vaxtime DD-MMM-YYYY HH:MM:SS.SS

  `VAXTIME' can be abbreviated on VMS, but must be the full CHAR*23
  format on any other computer.  The data are stored in the form given
  on the `TIME' card or with the `SET TIME' command and can be
  (`DAY', `HOUR', `MINUTE' or `SECOND', default is `DAY').
  A reference time (T=0) can
  be given and this must be in the form `YYMMDD HHMMSS'.

  Internally the plots are then stored in terms of the numbers of days
  (hours, minutes or seconds) since the reference time or since the
  1st point if you have not specified a reference time.

  The reference date/time is only used if you have set the axis mode
  to the same as the time mode:

  SET X MODE DATE       and SET TIME DAY  yymmdd
  SET X MODE TIME       and SET TIME HOUR yymmdd.hhmmss

  Otherwise the reference time is set to 0 and the axis mode is used
  to specify how the plot should be stored.

  If you store the date/time in an Ntuple and want to make a plot as a
  function of date or time use one of the date/time expressions
  (`DATE, TIME, DATE_TIM, DATE_MIN, TIME_MIN'). For more details on
  these functions see HELP Expressions. Note that you should avoid
  giving the Ntuple variables the same name as one of the functions,
  as Mn_Fit may well get confused! The `VAXTIME' form is not
  available for Ntuples.

  If you want to make an HBOOK histogram and then plot it as a
  function of date you should book it in terms of the numbers of days
  since 1-Jan-1980 00:00. For plots as a function of time book it in
  terms of the number of hours since 1-Jan-1980 00:00.

  At present reading in plots as a function of date and/or time only
  works for the x-axis. While you can specify date or time mode for
  other axes it is not fully implemented.

2 Examples

!\begin{enumerate}
!\item
!^
  Example 1:

    You have an Ntuple which contains dates, times and
    temperature. You want to plot the temperature vs date from the
    beginning to the end of 1995. Here is a simple ASCII file
    (`file.mnd'), but you could store the same thing in an HBOOK Ntuple:

    id 1
    title Temperature vs. time
    ntuple 3 ndate ntime temp
    data
    950203 120000 13
    950303 080000 -4
    950503 040000 0
    950603 165700 19
    950703 201000 30
    950903 120000 18
    end

    You read in the file and make and plot a projection:

    dat_fetch file.mnd
    set x mode date
    project 1 date_tim(ndate,ntime) temp &1 0 950101 960101
    ! Plot from 1-Jan-1995 to 1-Jan-1996
    plot 1&1
    ! Plot from 1-Jan-1995 to 1-Jun-1995
    set x lim 950101 950601
    plot 1&1

!\end{enumerate}

1 Y2K

  For Mn_Fit the magic year is 1980! In most of the code I stick with
  a 2 digit year. If the year is less than 80 I put it in the 21st
  century. If it is more than 80 it is assumed to be in the 20th
  century. In addition a year such as 101 should be treated at 2001 in
  most cases. Unfortunately I cannot cope properly with 4 digit
  years. You should use 020410 and not 20020410 to specify the 10th
  April 2002. The reason is that Mn_Fit internally uses real numbers
  and single precision is not sufficient for an 8 digit date.

  Note that for the L3 database interface year 2000 MUST be given as
  100 etc.

  If histograms have been or are created in 2000 or later using CERN
  library versions 98 or earlier, then the date within the histogram
  file will be screwed up. If Mn_Fit has been compiled with a 1998 or
  earlier version of the CERN library, you may also have problems with
  the display of dates.

