;;; parse-date.mhtml: -*- Meta-HTML -*- 

;;;  Copyright (c) 1996 Brian J. Fox
;;;  Author: Brian J. Fox (bfox@ua.com) Tue Nov  7 08:49:14 1995.

<defun parse-date-string>
  <set-var
    Jan=01 Feb=02 Mar=03 Apr=04 May=05 Jun=06
    Jul=07 Aug=08 Sep=09 Oct=10 Nov=11 Dec=12>

  <set-var temp=<get-var date::date-string>>
  <subst-in-var temp "[\t\n ]+" "\n">
  <set-var
    date::components[]=<get-var temp>
    date::weekday=<get-var date::components[0]>
    date::month=<get-var date::components[1]>
    date::day=<get-var date::components[2]>
    date::cday=<if <lt date::day 10>
		   "0<get-var date::day>"
		 <get-var date::day>>
    date::year=<get-var date::components[4]>
    date::canon1 = <concat <get-var <get-var date::month>>/
			   <get-var date::cday>/<get-var date::year>>
    date::canon = <concat <get-var <get-var date::month>>/
			  <get-var date::cday>/
			  <match <get-var date::year> ^19 action=delete>>>
</defun>
