Altova MapForce 2024 Enterprise Edition

Converts an xs:time input value into a string.

mf-func-format-time

 

Languages

Built-in, C++, C#, Java, XSLT 2.0, XSLT 3.0.

 

Parameters

Argument

Description

value

Mandatory argument. Supplies the xs:time value to be formatted.

format

Mandatory argument. Supplies a format string. This argument is used in the same way as the format argument in the format-dateTime function.

 

Example

The following mapping outputs the current time in a format like 2:15 p.m. . To achieve this, it uses the format string [h]:[m] [P], where:

 

[h] is the current hour in 12-hour format

[m] is the current minute

[P] is the "a.m." or "p.m." part

mf-func-format-time-example-01

Note that the mapping above is designed for the Built-in, C++, C#, or Java transformation languages. In XSLT 2.0, the same result can be achieved by the following mapping:

mf-func-format-time-example-02

© 2017-2023 Altova GmbH