Get From/To Unix/JSON Date Format

JavaScript
//Clear console
console.clear()

//Get Unix/json date format from date
console.log(new Date("2020-11-20T16:00:00Z").getTime())
1605888000000

//Get date from Unix/json date format
console.log(new Date(1605888000000).toUTCString())
Fri, 20 Nov 2020 16:00:00 GMT

Convert internal date to output format according user’s config

Use FM CONVERT_DATE_TO_EXTERNAL to convert data from internal format, to user format.

FORM convert_date_format
    USING
      value(p_internal_format)  TYPE datum
    CHANGING
      p_external_format  TYPE char10.
 CLEAR p_external_format.
 CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
   EXPORTING
     date_internal            = p_internal_format
   IMPORTING
     date_external            = p_external_format
   EXCEPTIONS
     date_internal_is_invalid = 1
     others                   = 2.
 IF sy-subrc <> 0.
     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
   ENDIF.
 ENDFORM.