× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Loek,

As James' has already mentioned, this API will not give you the timezone
information. The timezone parameter is obsolete, and does not get
populated. You can use the following code to get the timezone (I'm
assuming you want RPG, since you're on the RPG list!):


      * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - 
      * Procedure......: swTmRtnOfs
      * Description....: Return the offset from UTC to local time.
      *
      *
      * Parameter Name  Type          Description
      * --------------  ------------
-----------------------------------------------------
      * Required Group:
      *  iType          char(1)       Type of output value required:
      *                                'H' - hours
      *                                'M' - minutes
      *                                'S' - seconds
      *
      * Returns:
      *   offset value
        *
      * Copyright (c) 2002, Studioworks Technology Group Inc.
      * All Rights Reserved     
      * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - 
     P swTmRtnOfs      b                   export
     D                 pi             8f
     D iType                          1a   const

      *-- define an ILE condition token
     DdsCTK            ds
     D dsCTK_MsgSev                   5i 0
      *                                    Message severity
     D dsCTK_MsgNo                    2a
      *                                    Hex representation of message
ID.
     D                                1a
      *                                    Reserved
     D dsCTK_MsgPrfx                  3a
      *                                    Message ID Prefix
     D dsCTK_MsgKey                   4a
      *                                    Message key

      *-- API parameters
     d uHours          s             10i 0
     d uMinutes        s             10i 0
     d uSeconds        s              8f

      *-- misc variables
     d result          s              8f

      *-- call system API for offset value
     C                   callp     ceeRtnUtcOfs(uHours:
     C                                          uMinutes:
     C                                          uSeconds:
     C                                          dsCTK)

      *-- when error
     C                   select
     C                   when      ( dsCTK_MsgSev > 0 )
     C                   eval      result = *zeros

      *-- when caller wants the hours
     C                   when      ( iType = 'H' )
     C                   eval      result = uHours

      *-- when caller wants the minutes
     C                   when      ( iType = 'M' )
     C                   eval      result = (uHours * 60 )
     C                   if        ( uHours < 0 )
     C                   eval      result = result  + (uMinutes * -1)
     C                   else
     C                   eval      result = result  + uMinutes
     C                   endif

      *-- when caller wants the seconds
     C                   when      ( iType = 'S' )
     C                   eval      result = uSeconds

      *-- otherwise, caller is an idiot
     C                   other
     C                   eval      result = *zeros
     C                   endsl

      * return to caller
     C                   return    result


     P swTmRtnOfs      e


The prototype for CEERTNUTCOFS follows:


     š* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
     š* Return the offset from Universal Coordinated to Local Time
     š*   uHours   - Offset expressed in hours
     š*   uMinutes - Additional minutes from uHours.
     š*   uSeconds - Offset expressed in seconds
     š*   uApiErr  - 12-byte feedback code
     š* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
     D ceeRtnUTCOfs    pr                  extproc('CEEUTCO')
     D  uHours                       10i 0
     D  uMinutes                     10i 0
     D  uSeconds                      8f
     D  uCeeFbk                      12a   options(*omit)


Hope this helps. 


John Taylor



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.