


     GGGGEEEETTTTDDDDAAAATTTTEEEE((((3333))))			 XXXXEEEENNNNIIIIXXXX 3333....0000		    GGGGEEEETTTTDDDDAAAATTTTEEEE((((3333))))



     NNNNAAAAMMMMEEEE
	  getdate - convert time and date from ASCII

     SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
	  ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
	  ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttiiiimmmmeeeebbbb....hhhh>>>>

	  ttttiiiimmmmeeee____tttt ggggeeeettttddddaaaatttteeee((((bbbbuuuuffff,,,, nnnnoooowwww))))
	  cccchhhhaaaarrrr ****bbbbuuuuffff;;;;
	  ssssttttrrrruuuucccctttt ttttiiiimmmmeeeebbbb ****nnnnoooowwww;;;;

     DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
	  _G_e_t_d_a_t_e converts most	common time specifications to standard
	  UNIX internal	representation.	 The first argument is the
	  character string containing the time and date; the second is
	  the assumed current time (used for relative specifications);
	  if NNNNUUUULLLLLLLL is passed, _f_t_i_m_e(2) is used to obtain	the current
	  time and timezone.

	  The character	string consists	of 0 or	more specifications 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aaammmm or ppppmmmm
	       - is specified, a 24-hour clock is used.	 A _t_o_d may be
	       specified as just _h_h followed by	a _m_e_r_i_d_i_a_n.

	  date A _d_a_t_e is a specific month and day, and possibly	a
	       year.  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 number	less than 100,
	       1900 is added.  If a number not followed	by a day or
	       relative	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	_d_a_t_e(1)	or _c_t_i_m_e(3) to
	       be passed as input to _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 preceeded by
	       a _n_u_m_b_e_r, indicating which instance of that day is
	       desired;	the default is 1111.  Negative _n_u_m_b_e_r_s indicate
	       times past.  Some symbolic _n_u_m_b_e_r_s are accepted:	llllaaaasssstttt,
	       nnnneeeexxxxtttt, and the ordinals ffffiiiirrrrsssstttt through ttttwwwweeeellllfffftttthhhh (sssseeeeccccoooonnnndddd is
	       ambiguous, and is not accepted as an ordinal number).
	       The symbolic number nnnneeeexxxxtttt	is equivalent to 2222; thus, _n_e_x_t
	       _m_o_n_d_a_y refers not to the	immediately coming Monday, but
	       to the one a week later.

	  relative time
	       Specifications relative to the current time are also
	       accepted. The format is [_n_u_m_b_e_r]	_u_n_i_t; acceptable units



     Page 1					      (printed 8/2/94)






     GGGGEEEETTTTDDDDAAAATTTTEEEE((((3333))))			 XXXXEEEENNNNIIIIXXXX 3333....0000		    GGGGEEEETTTTDDDDAAAATTTTEEEE((((3333))))



	       are yyyyeeeeaaaarrrr, mmmmoooonnnntttthhhh,	ffffoooorrrrttttnnnniiiigggghhhhtttt, wwwweeeeeeeekkkk, ddddaaaayyyy, hhhhoooouuuurrrr, mmmmiiiinnnnuuuutttteeee,
	       and sssseeeeccccoooonnnndddd.

	  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	allowing for
	  daylight savings time	differences.

	  _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 without a trailing
	  period.  Units, such as wwwweeeeeeeekkkks, may be	specified in the
	  singular or plural.  Timezone	and meridian values may	be in
	  upper	or lower case, and with	or without periods.

     SSSSEEEEEEEE AAAALLLLSSSSOOOO
	  ctime(3), getabsdate(3), time(2)

     AAAAUUUUTTTTHHHHOOOORRRR
	  Steven M. Bellovin (uuuunnnncccc!!!!ssssmmmmbbbb),	Dept. of Computer Science,
	  University of	North Carolina at Chapel Hill

     BBBBUUUUGGGGSSSS
	  Because _y_a_c_c(1) is used to parse the date, _g_e_t_d_a_t_e cannot be
	  used as a subroutine to any program that also	needs _y_a_c_c.
	  _G_e_t_d_a_t_e is slow; this	is partly _y_a_c_c's fault.
	  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; _n_e_x_t _w_e_e_k is identical to _2	_w_e_e_k_s.
	  _G_e_t_d_a_t_e is eager to make sense of _b_u_f, and in	its zeal
	  sometimes produces incorrect results rather than a
	  diagnostic.  Relative	times are bad; all-numeric dates are
	  worse	(what does 1111////11112222////88885555 mean?  in the US?  in Canada?  in
	  England?); a single letter is	worst: it will be taken	to be
	  a US military	time zone.
	  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 _l_o_c_a_l_t_i_m_e(2) accepts an old-style time format
	  without zone information, attempting to pass _g_e_t_d_a_t_e a
	  current time containing a different zone will	probably fail.
	  There	is no good way to restrict _g_e_t_d_a_t_e to accept only
	  absolute times.
	  _G_e_t_d_a_t_e's timezone tables are	wrong, particularly the	US
	  military single-letter zones,	which have their signs
	  reversed.  Alphabetic	timezone names are obsolete.



     Page 2					      (printed 8/2/94)






     GGGGEEEETTTTDDDDAAAATTTTEEEE((((3333))))			 XXXXEEEENNNNIIIIXXXX 3333....0000		    GGGGEEEETTTTDDDDAAAATTTTEEEE((((3333))))



	  _G_e_t_d_a_t_e firmly believes that years after 1999	do not exist;
	  _g_e_t_d_a_t_e will have to be killed by the	year 2000.





















































     Page 3					      (printed 8/2/94)



