2008-06-22 00:29:13 -04:00
|
|
|
CCRUTIL ;CCRCCD/SMH - Various Utilites for generating the CCR/CCD;06/15/08
|
|
|
|
;;0.1;CCRCCD;;Jun 15, 2008;
|
|
|
|
|
|
|
|
W "No Entry at Top!" Q
|
|
|
|
|
2008-06-22 20:04:01 -04:00
|
|
|
FMDTOUTC(DATE,FORMAT) ; Convert Fileman Date to UTC Date Format; PUBLIC; Extrinsic
|
|
|
|
; FORMAT is Format of Date. Can be either D (Day) or DT (Date and Time)
|
|
|
|
; If not passed, or passed incorrectly, it's assumed that it is D.
|
|
|
|
; FM Date format is "YYYMMDD.HHMMSS" HHMMSS may not be supplied.
|
|
|
|
; UTC date is formatted as follows: YYYY-MM-DDThh:mm:ss_offsetfromUTC
|
|
|
|
; UTC, Year, Month, Day, Hours, Minutes, Seconds, Time offset (obtained from Mailman Site Parameters)
|
|
|
|
N UTC,Y,M,D,H,MM,S,OFF
|
2008-06-22 00:29:13 -04:00
|
|
|
S Y=1700+$E(DATE,1,3)
|
|
|
|
S M=$E(DATE,4,5)
|
|
|
|
S D=$E(DATE,6,7)
|
2008-06-22 20:04:01 -04:00
|
|
|
S H=$E(DATE,9,10)
|
|
|
|
S MM=$E(DATE,11,12)
|
|
|
|
S S=$E(DATE,12,13)
|
|
|
|
S OFF=$$TZ^XLFDT ; See Kernel Manual for documentation.
|
|
|
|
; If H, MM and S are empty, it means that the FM date didn't supply the time.
|
|
|
|
; In this case, set H, MM and S to "00"
|
|
|
|
S:('$L(H)&'$L(MM)&'$L(S)) (H,MM,S)="00"
|
|
|
|
S UTC=Y_"-"_M_"-"_D_"T"_H_":"_MM_":"_S_OFF
|
2008-06-23 22:48:11 -04:00
|
|
|
I $L($G(FORMAT)),FORMAT="DT" Q UTC ; Date with time.
|
2008-06-22 20:04:01 -04:00
|
|
|
E Q $P(UTC,"T")
|
2008-06-22 00:29:13 -04:00
|
|
|
;
|