source: WorldVistAEHR/trunk/r/VICTORY_PROGRAMMING_ENVIRONMENT-ZVEM/ZVEMSLA.m@ 702

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1ZVEMSLA ;DJB,VSHL**VA KERNEL Library Functions - Dates [8/18/95 1:30pm]
2 ;;12;VPE;;COPYRIGHT David Bolduc @1993
3 ;
4DATE ;;;
5 ;;; DATE FUNCTIONS - XLFDT
6 ;;;
7 ;;; HTFM(x,y)......%H to Fileman
8 ;;; x = $H date (in quotes)
9 ;;; y = 1 (optional) to return date portion only (no seconds)
10 ;;; Ex: W $$HTFM^XLFDT("54786,40523",1) --> 2901231
11 ;;;
12 ;;; FMTH(x,y)......Fileman to $H
13 ;;; x = Fileman date
14 ;;; y = 1 (Optional) no seconds.
15 ;;; Ex: W $$FMTH^XLFDT(2901231.111523) --> 54786,40523
16 ;;;
17 ;;; HTE(x,y)......$H to External
18 ;;; x = $H date (in quotes)
19 ;;; y = See FMTE(x,y) for alternate values
20 ;;; Ex: W $$HTE^XLFDT("54786,40523") --> Dec 31, 1990@11:15:23
21 ;;;
22 ;;; FMTE(x,y)......Fileman to External
23 ;;; x = VA Fileman date
24 ;;; y = optional - if null ('$D(y)) return written-out format
25 ;;; if +y=1 return written-out format
26 ;;; if +y=2 return in MM/DD/YY@HH:MM:SS format
27 ;;; if +y=3 return in DD/MM/YY@HH:MM:SS format
28 ;;; if +y=4 return in YY/MM/DD@HH:MM:SS format
29 ;;; if y contains S return seconds
30 ;;; if y contains D return date portion only
31 ;;; if y contains P return in HH:MM:SS am/pm format
32 ;;; Ex: W $$FMTE^XLFDT(2901231.111523,1) --> Dec 31, 1990@11:15:23
33 ;;; W $$FMTE^XLFDT(2901231.1115,"4D") --> 90/02/31
34 ;;;
35 ;;; DOW(x,y)......Day-of-Week
36 ;;; x = VA Fileman date
37 ;;; y = 1 (optional) to return day-of-week number
38 ;;; Ex: W $$DOW^XLFDT(2901231.111523) --> Monday
39 ;;;
40 ;;; HDIFF(x1,x2,x3)....$H Differences
41 ;;; To calculate the difference between 2 dates in $H format.
42 ;;; x1 = $H date (in quotes)
43 ;;; x2 = $H date, to subtract from the x1 date
44 ;;; x3 = see FMDIFF(x1,x2,x3) for alternative values
45 ;;;
46 ;;; FMDIFF(x1,x2,x3)....Fileman Difference
47 ;;; To calculate the difference between 2 dates in VA Fileman format.
48 ;;; x1 = VA Fileman date
49 ;;; x2 = VA Fileman date to subtract from x1 date
50 ;;; x3 = optional - if null return difference in days
51 ;;; if x3=1 return difference in days (x1-x2)
52 ;;; if x3=2 return difference in seconds
53 ;;; if x3=3 return difference in DD HH:MM:SS format
54 ;;; Ex: W $$FMDIFF^XLFDT(2901229,2901231.111523,1) --> -2
55 ;;; The 1st date is 2 days less than the 2nd date
56 ;;; W $$FMDIFF^XLFDT(2901231.111523,2901229.173404,2) --> 150079
57 ;;; The 1st date is 150079 seconds greater than the 2nd date
58 ;;;
59 ;;; HADD(x,d,h,m,s)....$H Add
60 ;;; To add days,hours,minutes, & seconds to a date in $H format (to x).
61 ;;; x = $H date (in quotes)
62 ;;; d = days
63 ;;; h = hours
64 ;;; m = minutes
65 ;;; s = seconds
66 ;;; Ex: W $$HADD^XLFDT("54786,3600",2,2,20,15) --> 54788,12015
67 ;;;
68 ;;; FMADD(x,d,h,m,s)...Fileman Add
69 ;;; Add days,hours,minutes, & seconds to a date in VA Fileman format (to x).
70 ;;; x = VA Fileman date
71 ;;; d,h,m,s same as HADD above
72 ;;; Ex: W $$FMADD^XLFDT(2901231.01,2,2,20,15) --> 2910102.032015
73 ;;;
74 ;;; NOW()...Current date/time in Fileman format
75 ;;; Ex: W $$NOW^XLFDT --> 2921009.08425
76 ;;;
77 ;;; DT()....Current date in Fileman format
78 ;;; Ex: W $$DT^XLFDT --> 2921009
79 ;;;***
Note: See TracBrowser for help on using the repository browser.