EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
Expand all | Collapse all

Date Format

  • 1.  Date Format

    Posted Mon March 28, 2016 07:19 PM

    Hi

    I have a variable field defined in FormText

      TAB035DATA num(10)

      {Position =[9, 16], fieldLen = 10, validationOrder = 1,

      color = defaultColor, highlight = noHighlight, align = right,

      intensity = normalIntensity, protect = Protect,

      dateFormat = "dd/MM/yyyy", fillCharacter = nullFill, ZeroFormat = yes, numericSeparator = no, sign = none};

    the statement

    TAB035DATA = 28032016; // ddMMyyyy

    I got an error when Debug

    EGL0102E The value 28032016 of type string can not be converted to date type.

    and if I reverse the date value to

    TAB035DATA = 20160328; // yyyyMMdd

    It Works !

    The question is:

    The internal value is always:

    "00yyyyMMdd" to form field defined numeric edit

    or

    "yyyy/MM/dd" to form field defined no numeric edit

    Is it true ? as EGL Works ?

    When the form field has dateFormat property  setted

    Hsieh


  • 2.  Re: Date Format

    Posted Tue March 29, 2016 08:06 PM

    Hsieh,

     

    Are you asking what the internal format is for a date if it is defined as NUM or if defined as CHAR?

    And I assume you are asking related to form fields?  Correct?

     

    Mark

     

     

    markevans


  • 3.  Re: Date Format

    Posted Wed March 30, 2016 04:25 AM

    Hi Mark,

     

    Yes. If the variable field in FormText defined below:

     

    TAB035DATA num(10)

      {Position =[9, 16], fieldLen = 10, validationOrder = 1,

      color = defaultColor, highlight = noHighlight, align = right,

      intensity = normalIntensity, protect = Protect,

      dateFormat = "dd/MM/yyyy"fillCharacter = nullFill, ZeroFormat = yes, numericSeparator = no, sign = none};

     

    I can only assign to TAB035DATA = 20160328 (yyyyMMdd) to be date Format = dd/MM/YYYY ;

    Why I cannot assign to TAB035DATA = 28032016 (ddMMyyyy) to be date Format = dd/MM/YYYY  ?

    If I try to use this way I got an error: "EGL0102E The value 28032016 of type string can not be converted to date type"

     

    Is  default  to EGL always internal storage as yyyyMMdd  ?

     

    Thanks !  I hope you have understood.

    Hsieh


  • 4.  Re: Date Format

    Posted Wed March 30, 2016 08:18 AM

    Hsieh,

     

    I will let some of the others confirm, but my understanding is the internal format is yyyyMMdd so there is a common standard to work from.  Then the data is formatted to be displayed based on what you define (or national language).

     

    Mark

    markevans