Fix to date format if minutes or seconds are not in record

This commit is contained in:
george 2008-08-29 18:40:24 +00:00
parent 40c3f85491
commit 7dfb1ab484
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,10 @@ FMDTOUTC(DATE,FORMAT) ; Convert Fileman Date to UTC Date Format; PUBLIC; Extrins
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:('$L(H)&'$L(MM)&'$L(S)) (H,MM,S)="00" ; IF ONLY SOME ARE MISSING?
S:'$L(H) H="00"
S:'$L(MM) MM="00"
S:'$L(S) S="00"
S UTC=Y_"-"_M_"-"_D_"T"_H_":"_MM_$S(S="":":00",1:":"_S)_OFF ; Skip's code to fix hanging colon if no seconds
I $L($G(FORMAT)),FORMAT="DT" Q UTC ; Date with time.
E Q $P(UTC,"T")