


NSR_GETDATE(3)                                     NSR_GETDATE(3)


NNAAMMEE
       nsr_getdate - convert time and date from ASCII

SSYYNNOOPPSSIISS
       ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>

       ttiimmee__tt nnssrr__ggeettddaattee((bbuuff))
       cchhaarr **bbuuff;;

DDEESSCCRRIIPPTTIIOONN
       The nnssrr__ggeettddaattee(()) routine converts most common time speci-
       fications to standard UNIX format.  It takes  a  character
       string  containing  time  and date as an argumant and con-
       verts it to a time format.

       The character string consists of zero or  more  specifica-
       tions of the following form:

       tod    A  _t_o_d  is  a  time  of  day,  which is of the form
              _h_h[:_m_m[:_s_s]] (or _h_h_m_m) [_m_e_r_i_d_i_a_n]  [_z_o_n_e].   If  no
              meridian - _a_m or _p_m - is specified, a 24-hour clock
              is used.  A _t_o_d may be specified as  just  _h_h  fol-
              lowed  by  a  _m_e_r_i_d_i_a_n.   If  no zone (e.g. GMT) is
              specified, the current timezone, as  determined  by
              the second parameter, _n_o_w, is assumed.

       date   A  _d_a_t_e is a specific month and day, and possibly a
              year.  The acceptable formats  are  _m_m_/_d_d[_/_y_y]  and
              _m_o_n_t_h_n_a_m_e _d_d[, _y_y] If omitted, the year defaults to
              the current year.  If a year is specified as a num-
              ber  in  the  range 70 and 99, 1900 is added.  If a
              year is in the range 00 and 30, 2000 is added.  The
              treatment  of  other  years  less than 100 is unde-
              fined.  If a number not followed by a day or  rela-
              tive  time unit occurs, it will be interpreted as a
              year if a _t_o_d, _m_o_n_t_h_n_a_m_e, and _d_d have already  been
              specified;  otherwise, it will be treated as a _t_o_d.
              This  rule  allows  the  output  from  ddaattee(1)   or
              ccttiimmee(3) to be passed as input to _n_s_r___g_e_t_d_a_t_e_.

       day    A _d_a_y of the week may be specified; the current day
              will be used if appropriate.  A _d_a_y may be preceded
              by  a _n_u_m_b_e_r_, indicating which instance of that day
              is desired; the default  is  _1.   Negative  _n_u_m_b_e_r_s
              indicate  times  past.   Some  symbolic _n_u_m_b_e_r_s are
              accepted:  llaasstt,  nneexxtt,  and  the  ordinals   ffiirrsstt
              through  ttwweellfftthh  (sseeccoonndd  is ambiguous, and is not
              accepted as an ordinal number).  The symbolic  num-
              ber  nneexxtt  is  equivalent  to  22; thus, nneexxtt mmoonnddaayy
              refers not to the immediately coming Monday, but to
              the one a week later.

       relative time
              Specifications  relative  to  the  current time are



NetWorker rt_1998_4Q.Build.MMaJrFcehra0l8_,0021000                        1





NSR_GETDATE(3)                                     NSR_GETDATE(3)


              also  accepted.   The  format  is  [_n_u_m_b_e_r]   _u_n_i_t;
              acceptable  units are yyeeaarr, mmoonntthh, ffoorrttnniigghhtt, wweeeekk,
              ddaayy, hhoouurr, mmiinnuuttee, and sseeccoonndd.

       The actual date is formed as follows: first, any  absolute
       date  and/or  time is processed and converted.  Using that
       time as the base, day-of-week  specifications  are  added;
       last,  relative specifications are used.  If a date or day
       is specified, and no absolute or relative time  is  given,
       midnight  is  used.   Finally,  a correction is applied so
       that the correct hour of the day is produced after  allow-
       ing for daylight savings time differences.

       _N_s_r___g_e_t_d_a_t_e  accepts  most  common abbreviations for days,
       months, etc.; in particular, it will recognize  them  with
       upper  or  lower  case  first  letter,  and will recognize
       three-letter abbreviations for any of them, with or  with-
       out a trailing period.  Units, such as wweeeekks, may be spec-
       ified in the singular or plural.   Timezone  and  meridian
       values  may be in upper or lower case, and with or without
       periods.

SSEEEE AALLSSOO
       ccttiimmee(3), ddaattee(1), ffttiimmee(3c), llooccaallttiimmee(2), ttiimmee(2).

BBUUGGSS
       The grammar and  scanner  are  rather  primitive;  certain
       desirable  and unambiguous constructions are not accepted.
       Worse yet, the meaning of some legal phrases is  not  what
       is expected; nneexxtt wweeeekk is identical to 22 wweeeekkss.

       The  daylight  savings time correction is not perfect, and
       can get confused if handed times between midnight and 2:00
       am on the days that the reckoning changes.

       Because  llooccaallttiimmee(2)  accepts  an  old-style  time format
       without zone information, passing  _n_s_r___g_e_t_d_a_t_e  a  current
       time containing a different zone will probably fail.



















NetWorker rt_1998_4Q.Build.MMaJrFcehra0l8_,0021000                        2


