Altova MapForce 2024 Professional Edition

Converts a date value of type xs:date to a string and formats it according to specified options.

mf-func-format-date

 

Languages

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

 

Parameters

Argument

Description

value

The xs:date value to be formatted.

format

A format string identifying the way in which the date is to be formatted. This argument is used in the same way as the format argument in the format-dateTime function.

language

Optional argument. When supplied, the name of the month and the day of the week are returned in a specific language. Valid values:

 

de

German

en (default)

English

es

Spanish

fr

French

ja

Japanese

 

Example

The following mapping outputs the current date in a format like: "25 March 2020, Wednesday". To translate this value to Spanish, set the value of the language argument to es.

mf-func-format-date-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-date-example-02

© 2018-2024 Altova GmbH