Timeformat
This reference explains how to format the timeFormat parameter in the logging section of the aqishare, as well as the script parameter for Tasks either invoking RFC or REST.
Reference Time Layout
Mon Jan 2 15:04:05 MST 2006
Formatting the current date with the layout above returns: Wed Oct 30 10:54:50 UTC 2024
Below is a reference of all available layouts to be used:
Required Part of Date | Use Layout | Layout results based on current date |
---|---|---|
Year | 2006 or06 | Layout 2006 returns 2024Layout 06 returns 24 |
Month | Jan orJanuary or01 or1 | Jan : OctJanuary : October01 : 101 : 10 |
Day of the week | Mon orMonday | Mon : WedMonday : Wednesday |
Day of the month | 2 (without padding) or_2 (with leading space) or02 (with leading zero) | 2 : 30_2 : 30 02 : 30 |
Day of the year | __2 (two leading digits) or002 (with leading zeros) | __2 : 304304 |
Hour | 15 (24-h format) or3 (12-h format without leading zero) or03 (with leading zero) | 15 : 103 : 1003 : |
Minute | 4 (without leading zero) or04 (with leading zero) | 4 : 5404 : 54 |
Second | 5 (without leading zero) or05 (with leading zero) | 5 : 50 05 : 50 |
AM/PM mark | PM | PM : AM |
Examples
Format Date to SAP standard format
In SAP ABAP, the type for date fields is DATS, which stores calendar dates in the format YYYYMMDD
. To format a date to match this definition, use the following layout.
Timeformat Layout for SAP Dates
20060102
The layout for SAP dates, used with the Format() function, would look like this: Format('20060102', now)
and it returns the current date in SAP's DATS format: 20241030