The standard T24 subroutine DIETER.DATE is useful for converting dates
between T24 format and various jBASE formats in both directions. See
example code to demonstrate usage:

    DIETER.DATE.DEMO
001     PROGRAM DIETER.DATE.DEMO
002 * Demonstrates the usage of the standard T24 subroutine
DIETER.DATE.
003
004     GLOBUS.DATE = "20101102"
005
006 * Convert T24 format to jBase formats
007     DATE.CONV.FMT = ""
008     GOSUB SHOW.CONV.DATE
009
010     DATE.CONV.FMT = "D4"
011     GOSUB SHOW.CONV.DATE
012
013     DATE.CONV.FMT = "DWA"
014     GOSUB SHOW.CONV.DATE
015
016 * Convert jBase internal (Pick) format back to Globus/T24
(YYYYMMDD)
017     GLOBUS.DATE = ""
018     JBASE.INT.DATE = "15647"
019     DATE.CONV.FMT = ""
020     CALL DIETER.DATE(GLOBUS.DATE, JBASE.INT.DATE, DATE.CONV.FMT)
021     CRT
022     CRT "jBase to T24 converted date = ":GLOBUS.DATE
023
024     STOP
025
026 SHOW.CONV.DATE:
027     JBASE.CONV.DATE = ""
028     CALL DIETER.DATE(GLOBUS.DATE, JBASE.CONV.DATE, DATE.CONV.FMT)
029     CRT
030     CRT "T24 to jBase Converted Date = ":JBASE.CONV.DATE
031
032     RETURN

jsh Oceanic_Prod ~ -->RUN PHIL.BP DIETER.DATE.DEMO

T24 to jBase Converted Date = 15647

T24 to jBase Converted Date = 02 NOV 2010

T24 to jBase Converted Date = TUESDAY

jBase to T24 converted date = 20101102


Regards
Philip


On Nov 9, 8:57 pm, Williams <[email protected]> wrote:
> I need help regarding the piece of code below:
>
>     SUBROUTINE TEST.DATES
>     $INSERT I_COMMON
>     $INSERT I_EQUATE
>    
>     CALC.DATE = '20101102'
>     DAY.STR = OCONV(CALC.DATE,'DWA')
>
>     PRINT DAY.STR
>
> END
>
> The system returns SUNDAY. I expect this to be TUESDAY because 20101102 is
> Tuesday.
>
> Anybody with idea please.
>
> Williams

-- 
Please read the posting guidelines at: 
http://groups.google.com/group/jBASE/web/Posting%20Guidelines

IMPORTANT: Type T24: at the start of the subject line for questions specific to 
Globus/T24

To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

Reply via email to