Name
[2.0] format-time()
Given an xs:time
value and a format string, returns the formatted time
value.
Syntax
xs:stringformat-time(xs:time?,$picture as xs:string)xs:stringformat-time(xs:time?,$picture as xs:string,$language as xs:string?,$calendar as xs:string?,$country as xs:string?)
Inputs
In the first form of this function, an optional xs:time value and a formatting string.
If the xs:time value is
omitted, the current time is used. In the second form of this
function, you can supply strings that represent the preferred
language, calendar, and country codes for the output value.
The following codes are defined for the formatting string:
HThe hour in the day, in a 24-hour clock. The default value is
[H1], which generates the one- or two-digit number of the hour in the day. Note that this value will never be greater than23.hThe hour in the day, in a 12-hour clock. The default value is
[h1], which generates the one- or two-digit number of the hour in the day.PThe AM/PM marker. The default value is
[Pn], which generates the AM/PM marker in lowercase (a.m.orp.m.).mThe minute in the hour. The default value is
[m01], which generates the two-digit minute in the hour.sThe second in the minute. The default value is
[s01], which generates the two-digit second in the minute.fThe fractional seconds. The default value is
[f1], which generates the fractional seconds to three decimal places.ZThe timezone as an offset from UTC. The default value is
[Z1], which generates the hour and minute ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access