Title: | *OLD* ALL-IN-1 (tm) Support Conference |
Notice: | Closed - See Note 4331.l to move to IOSG::ALL-IN-1 |
Moderator: | IOSG::PYE |
Created: | Thu Jan 30 1992 |
Last Modified: | Tue Jan 23 1996 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 4343 |
Total number of notes: | 18308 |
Are Julian date formats used anywhere in ALL-IN-1? The customer would like to see his/her dates displayed in the Julian format. Has anyone attempted this customization before? Thanx, David
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
965.1 | No and yes | ACUMEN::VICKERS | Rearranging the DEChairs | Wed Jul 01 1992 01:46 | 10 |
As far as I am aware, Julian dates are no used within ALL-IN-1 anywhere. I will post a script that I wrote for a customer a few months ago which does return a Julian date. I suspect that the logic in the script can be improved but it does work. Feel free to improve upon it as you see fit. I hope that it provides some value, don | |||||
965.2 | Julian_Date.SCP | ACUMEN::VICKERS | Rearranging the DEChairs | Wed Jul 01 1992 01:47 | 73 |
! JULIAN_DATE.SCP Compute the Julian date for an NBS date ! ! Input ! ! #JULIAN_NBS The NBS date to be converted to Julian ! If blank then the current date is used ! ! Output ! ! #JULIAN_DATE The Julian date in the form YYDDD ! ! ! Days Til this Month (if not a leap year) ! "FebMarAprMayJunJulAugSepOctNovDec" GET #JULIAN_DTM = "031059090120151181212243273304334" DECIMAL I ! .IF #JULIAN_NBS EQS "" THEN GET #JULIAN_NBS = OA$DATE_NBS ! GET #JULIAN_DAY = #JULIAN_NBS:2:6 GET #JULIAN_MNTH = #JULIAN_NBS:2:4 GET #JULIAN_YEAR = #JULIAN_NBS:4 ! ! In January the logic is moderately simple ! .IF #JULIAN_MNTH EQ 1 THEN .GOTO PACK_IT_UP ! ! Add in the days prior to this month (starting at Feb) ! COMPUTE #JULIAN_OFFSET = (#JULIAN_MNTH - 2) * 3 GET OA$FUNCTION = "GET #JULIAN_DAYS = #JULIAN_DTM:3:" #JULIAN_OFFSET COMPUTE #JULIAN_DAY = #JULIAN_DAY + #JULIAN_DAYS ! ! If it's just February then we don't worry over leaping ! .IF #JULIAN_MNTH EQ 2 THEN .GOTO PACK_IT_UP ! ! Check for this being a leap year ! COMPUTE #JULIAN_LEAP = #JULIAN_YEAR / 4 COMPUTE #JULIAN_LEAP = #JULIAN_LEAP * 4 .IF #JULIAN_LEAP NE #JULIAN_YEAR THEN .GOTO PACK_IT_UP ! ! Assume it's a leap year and add the day ! COMPUTE #JULIAN_DAY = #JULIAN_DAY + 1 .IF #JULIAN_YEAR:2:2 NES "00" THEN .GOTO PACK_IT_UP ! ! It's a century so it might not be a leap year ! COMPUTE #JULIAN_LEAP = #JULIAN_YEAR / 400 COMPUTE #JULIAN_LEAP = #JULIAN_LEAP * 400 .IF #JULIAN_LEAP EQ #JULIAN_YEAR THEN .GOTO PACK_IT_UP COMPUTE #JULIAN_DAY = #JULIAN_DAY - 1 ! ! Pack the fields into the output symbol ! .LABEL PACK_IT_UP .IF #JULIAN_DAY GT 99 THEN .GOTO JOIN_EM ! ! Here we must place leading zeroes on the days ! DECIMAL 3 COMPUTE #JULIAN_DAY = #JULIAN_DAY/1000.0 DECIMAL 1 GET #JULIAN_DAY = #JULIAN_DAY:3:2 ! .LABEL JOIN_EM ! GET #JULIAN_DATE = #JULIAN_YEAR:2:2 #JULIAN_DAY ! ! [End] |