PROGRAM iDate
LastUpdated... = "Rev: 18:59 08Jun1995 u2443 5 /users/u2443/BP/IDATE"
* Program to display internal dates.
$INCLUDE UPCASE.EQUATES

open "SYS.CTL" to ConstantsFile else stop "NO SYS.CTL (idate)"
read T1 from ConstantsFile, "T1" else T1 = ""

oDate = field(trim(upcase(@SENTENCE))," ",2,1)
if oDate matches "1N0N" then            ;* Assume it's in internal format...
   iDate = oDate
   oDate = oconv(iDate,"D4-")
end else
   if oDate ne "" then
      iDate =  iconv(oDate,"D")
   end else
      iDate = date()
   end
end
locate iDate in T1<15,1> by "AR" setting PeriodIdx else null
PeriodStart = oconv(T1<14,PeriodIdx>,"D4")
PeriodEnd   = oconv(T1<15,PeriodIdx>,"D4")
Period      = T1<17,PeriodIdx>
s = space(5)
crt iDate:s:oconv(iDate,"DDMY,A,A4,WA"):s:Period:s:"[":PeriodStart:" - ":PeriodEnd:"]"
end
