source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCUDT.m@ 1582

Last change on this file since 1582 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.2 KB
Line 
1PRCUDT ;WISC/DJM/DL-DATE utility for transactions for IFCAP ;1/28/98 1445
2V ;;5.0;IFCAP;**155**;4/21/95
3 Q
4DT(C,DATE1,TIME1) ;CONVERTS TRANS DATE AND TRANS TIME INTO HUMAN READABLE FORM
5 ; INPUT
6 ; C THE TRANSACTION HEADER SEGMENT
7 ;
8 ; OUTPUT
9 ; DATE1 THE DATE FORMATTED AS "JAN 14, 1992"
10 ; TIME1 THE TIME FORMATTED AS "9:42:34 AM" or
11 ; "midnight" for 00:00:00 or
12 ; "noon" for 12:00:00
13 ;
14 N AP,DATE,DAY,DAYS,II,MO,S,TIME,TOTAL,YR S DATE=$P(C,U,5),TIME=$P(C,U,6)
15 S S=":",YR=$E(DATE,1,4),DAY=+$E(DATE,5,7),DAYS="31^28^31^30^31^30^31^31^30^31^30^31"
16 S $P(DAYS,U,2)=$S(YR#400=0:29,(YR#4=0&(YR#100'=0)):29,1:28)
17 S TOTAL="" F MO=1:1:12 S DAY=DAY-$P(DAYS,U,MO) Q:DAY'>0 S TOTAL=TOTAL+$P(DAYS,U,MO)
18 S DAY=+$E(DATE,5,7)-TOTAL,YR=YR-1700,MO=$S($L(MO)=1:"0"_MO,1:MO),DAY=$S($L(DAY)=1:"0"_DAY,1:DAY),Y=YR_MO_DAY_"."_TIME D DD^%DT S DATE1=$P(Y,"@"),TIME1=$P(Y,"@",2),$P(TIME1,S)=+$P(TIME1,S)
19 S AP=$S($P(TIME1,S)>11:"P",1:"A")_"M" S:AP="PM"&($P(TIME1,S)>12) $P(TIME1,S)=$P(TIME1,":")-12 S:$P(TIME1,S)=0 $P(TIME1,S)=12 S:TIME1="12:00" TIME1="12 "_$S(AP="AM":"midnight",1:"noon"),AP=""
20 S TIME1=TIME1_$S($L(AP):" "_AP,1:"") Q
Note: See TracBrowser for help on using the repository browser.