source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XQDATE.m@ 717

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

initial load of WorldVistAEHR

File size: 1.0 KB
Line 
1XQDATE ;SEA/MJM - Return Human Readible Date ;04/13/98 13:48
2 ;;8.0;KERNEL;**71,46**;Jul 10, 1995
3 ;Input: XQD1 contains $H to be converted, defaults to now if not
4 ;present. Output: % contains date in FileMan format, %Y contains
5 ;date and time in Human format (Feb. 20, 1991 5:35 PM)
6 ;
7 ;Modified 1/27/98 to reflect Y2K corrections.
8 ;
9 S U="^" I '$D(XQD1) S XQD1=$H
10 S %=$$HTFM^XLFDT(XQD1)
11 S %Y=$$FMTE^XLFDT(%,"1P")
12 K XQD1
13 Q
14 ;
15 S %=XQD1>21608+XQD1-.1,XQD2=%\365.25+141,%=%#365.25\1,XQD3=%+306#(XQD2#4=0+365)#153#61#31+1,XQD4=%-XQD3\29+1,XQD5=XQD2_"00"+XQD4_"00"+XQD3
16 S %=$P(XQD1,",",2),%=%#60/100+(%#3600\60)/100+(%\3600)/100,%=XQD5_$S(%:%,1:"")
17 S XQD1="Jan^Feb^Mar^Apr^May^Jun^Jul^Aug^Sep^Oct^Nov^Dec"
18 S %Y=$P(XQD1,U,XQD4),%Y=%Y_$S(%Y["May":"",1:".")_" "_XQD3_", "_(XQD2+1700)
19 S XQD2=$E($P(%,".",2),1,4) I $L(XQD2)<4 F XQD5=0:0 S XQD2=XQD2_"0" Q:$L(XQD2)=4
20 S XQD4=$S(XQD2>1159:"PM",1:"AM"),XQD3=$E(XQD2,1,2),XQD3=$S(XQD3>12:XQD3-12,1:XQD3),XQD2=$E(XQD2,3,4)
21 S %Y=%Y_" "_+XQD3_":"_XQD2_" "_XQD4
22 K XQD1,XQD2,XQD3,XQD4,XQD5
23 Q
Note: See TracBrowser for help on using the repository browser.