xtd 0.2.0
Loading...
Searching...
No Matches

◆ to_string() [2/3]

string xtd::time_span::to_string ( const string format) const

Converts the value of the current xtd::time_span object to its equivalent string representation by using the specified format.

Parameters
formatA single format specifier that indicates how to format the value of this xtd::time_span.
Returns
The string representation of the current xtd::time_span value in the format specified by the format parameter.
Exceptions
xtd::format_exceptionThe format parameter is not recognized or is not supported.
Remarks
The format parameter can be any valid standard specifier for XTD::time_span values. If format is equal to xtd::string::empty_string (""), the return value of the current xtd::time_span object is formatted with the common format specifier ("c").
The formatting codes for xtd::time_span::to_string (const xtd::string&) are listed below:
Format Print
'c' write duration with optional ticks d.hh.mm.ss.ticks
'd' write absolute value of days d
'D' write absolute value of days dd
'f' write duration d.h.mm.ss.ticks
'F' write duration d.hh.mm.ss.ticks
'g' write duration with optional ticks d.h.mm.ss.ticks
'G' write duration with optional ticks d.hh.mm.ss.ticks
'h' write absolute value of hours h
'H' write absolute value of hours hh
'l' write absolute value of milliseconds
'L' write absolute value of milliseconds fixed at 3 digits
'm' write absolute value of minutes m
'M' write absolute value of minutes mm
'o' write optional minus sign
'o' write minus or plus sign
's' write absolute value of seconds s
'S' write absolute value of seconds ss
't' write absolute value of ticks
'T' write absolute value of ticks fixed at 7 digits