Show TOC

Background documentationDate and Time Format Locate this document in the navigation structure

 

The following table lists characters that you can use in date and time formats in SAP Manufacturing Integration and Intelligence (SAP MII):

Character

Description

Format

Example

G

Era

Text

AD

y

Year

Number

1996

M

Month

Text or number

July or 07

d

Day of the month (1-31)

Number

10

h

Hour in AM or PM (1-12)

Number

12

H

Hour in the day (0-23)

Number

21

m

Minute (0-60)

Number

30

s

Second (0-60)

Number

55

S

Millisecond

The system does not use the millisecond portion of a date and time string; instead, it returns 0. If you are using the string HH:mm:ss.SSS and have a date and time value of 14:25:05.123, this value is converted to 14 hours, 25 minutes, and 5 seconds. If you try to output the value using the format hh:mm:ss.S aa, the system returns 02:25:05.0 PM.

Number

978

E

Day of the week

Text

Tuesday

D

Day of the year

Number

189

F

Day of the week in the month

Number

2 (second Wednesday in July)

w

Week in year

Number

27

W

Week in month

Number

2

a

AM or PM

Text

PM

k

Hour in the day (1-24)

Number

24

K

Hour in AM or PM (0-11)

Number

0

z

Time zone

Text

Pacific Standard Time

'

Escape for text

Delimiter

"

Single quote

Literal

'

The number of characters determines the format as follows:

  • Text

    Four or more characters returns the full form (for example, EEEE=Monday). Less than four characters returns the short or abbreviated form, if one exists (for example, EE=Mon).

  • Number

    The number of characters equals the maximum number of digits. Shorter numbers are zero-padded to this amount (for example, the seventh day of the year as DDD returns 007). Year (y) is a special case; if you entered yy, the year is truncated to two digits (for example, 98).

  • Text or Number

    Three or more characters return text (for example, MMM=November). Less than three characters return a number (for example, MM=11).

The system treats characters not in the ranges of a-z and A-Z as quoted text. For example, characters like the colon, period, pound sign, and at sign appear in the result even they are not in single quotes.

If you wish to include a time format but not a date format, clear the value from the Date Format field and enter a time format. The reverse is also true.

Note Note

SAP MII supports the Gregorian calendar only.

End of the note.

Example

Format

Result

"yyyy.MM.dd G 'at' hh:mm:ss z"

1996.07.10 AD at 15:08:56 PDT

"EEE, MMM d, "yy"

Wed, July 10, '96

"h:mm a"

12:08 PM

"hh 'o"clock' a, zzzz"

12 o'clock PM, Pacific Daylight Time

"K:mm a, z"

0:00 PM, PST

"yyyyy.MMMMM.dd GGG hh:mm aaa"

1996.July.10 AD 12:08 PM

If you want to display March 20, 1997 2:30 PM in the dd-MM-yyyy HH:mm:ss format, the result is 20-03-1997 14:30:00.

If you want to display March 20, 1997, 2:30 PM in the MMM dd h:mm a format, the result is MAR 20 2:30 PM.