Skip to Content

Determine if sy-datum variable is summertime or wintertime

Hi all,

is there a standard way (fm or method) in SAP to determine if a local variable of type sy-datum is in the date range of summertime or wintertime? I was looking for something that takes in input the local variable date and returns 'Summertime' or 'Wintertime' as output.

Please help.

James

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Nov 10, 2016 at 09:54 AM

    We've done this via FM "TZON_INTERNAL_TO_IETF" :

      call function 'TZON_INTERNAL_TO_IETF'
        EXPORTING
          if_timezone         = 'CET'
          if_year             = sy-datum(4)
        IMPORTING
          et_ietf_data        = lt_shiftdates
        EXCEPTIONS
          time_zone_not_found = 1
          dst_rule_not_found  = 2
          others              = 3.

    The output table should provide the dates by which 'STANDARD' changes to 'DAYLIGHT' by checking the Dates with Prefix 'DTSTART:'.

    Hope this helps ...

    Nic T.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 09:29 AM

    It depends also which time zone is your input date. You have to define a rule (for instance, there's a time zone in the user profile). When you have chosen the right time zone, then you may use CONVERT TIME STAMP (input is a UTC timestamp + a time zone) to get the Daylight Saving Time indicator.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 09:12 AM

    there is a systemfield SY-DAYST

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 09:32 AM

    if it's Day Light Saving Time the flag is 'X'

    if it's not the flag is space.

    The flag is set at operating system level.

    Add comment
    10|10000 characters needed characters exceeded