Formatting Time

sap.ui.core.format.DateFormat

Intro

This article describes the international rules for time formats. The SAPUI5 time formatters will help you to comply with these rules.

Usage

Use time formatting if:

Types

You can use three different types of time formats: short, medium, and long. The formatting and order of the values differ based on the locale settings that have been configured in the browser.

Short

In short format, time is displayed to the user in hours and minutes only.

Formatting differences - Short format

Formatting differences - Short format

Medium

If you need to display the seconds, use the medium time format.

Formatting differences - Medium format

Formatting differences - Medium format

Long

If you need to display a time zone, use the long time format.

Formatting differences - Long format

Formatting differences - Long format

Guidelines

[internal_only]

[/internal_only]

Durations

If you need to display durations, show every number and unit of measurement according to the rules for units of measurement. (For example, use long text instead of ISO codes or abbreviations.)

Do

Use long text to display durations

Use long text to display durations

Don't

Do not use abbreviations when durations have to be displayed

Do not use abbreviations when durations have to be displayed

Time Intervals

If you need to display time intervals, use “–” as a delimiter between the times.

Example of how to display time intervals

Example of how to display time intervals

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Visual Design

  • No links