[#BloombergLP-bdlt-TimeUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::TimeUtil
:relfileprefix: ../../
:mrdocs:

This `struct` provides a namespace for common non&hyphen;primitive procedures that operate on `Time` objects&period; These methods are alias&hyphen;safe and exception&hyphen;neutral&period;

== Synopsis

Declared in `&lt;bdlt&lowbar;timeutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct TimeUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/TimeUtil/convertFromHHMM.adoc[`convertFromHHMM`] 
| Return the `bdlt&colon;&colon;Time` value corresponding to the specified `timeValue`, where `timeValue` is a non&hyphen;negative integer that, when expressed in decimal notation, contains exactly four digits (counting leading zeros, if any)&colon; two digits for the hour and two digits for the minute&period; For example, 309 is converted to `Time(3, 9)` (03&colon;09&colon;00&period;000)&period; More formally, `timeValue` is interpreted as&colon; &grave; hour &ast; 100 &plus; minute &grave; The behavior is undefined unless `timeValue` represents a valid time in the allowable range for `bdlt&colon;&colon;Time` (00&colon;00&colon;00&period;000 &hyphen; 23&colon;59&colon;00&period;000, and 24&colon;00&colon;00&period;000)&period;
| xref:BloombergLP/bdlt/TimeUtil/convertFromHHMMSS.adoc[`convertFromHHMMSS`] 
| Return the `bdlt&colon;&colon;Time` value corresponding to the specified `timeValue`, where `timeValue` is a non&hyphen;negative integer that, when expressed in decimal notation, contains exactly six digits (counting leading zeros, if any)&colon; two digits for the hour, two digits for the minute, and two digits for the second&period; For example, 30907 is converted to `Time(3, 9, 7)` (03&colon;09&colon;07&period;000)&period; More formally, `timeValue` is interpreted as&colon; &grave; hour &ast; 10000 &plus; minute &ast; 100 &plus; second &grave; The behavior is undefined unless `timeValue` represents a valid time in the allowable range for `bdlt&colon;&colon;Time` (00&colon;00&colon;00&period;000 &hyphen; 23&colon;59&colon;59&period;000, and 24&colon;00&colon;00&period;000)&period;
| xref:BloombergLP/bdlt/TimeUtil/convertFromHHMMSSmmm.adoc[`convertFromHHMMSSmmm`] 
| Return the `bdlt&colon;&colon;Time` value corresponding to the specified `timeValue`, where `timeValue` is a non&hyphen;negative integer that, when expressed in decimal notation, contains exactly nine digits (counting leading zeros, if any)&colon; two digits for the hour, two digits for the minute, two digits for the second, and three digits for the millisecond&period; For example, 30907056 is converted to `Time(3, 9, 7, 56)` (03&colon;09&colon;07&period;056)&period; More formally, `timeValue` is interpreted as&colon; &grave; hour &ast; 10000000 &plus; minute &ast; 100000 &plus; second &ast; 1000 &plus; millisecond &grave; The behavior is undefined unless `timeValue` represents a valid time in the allowable range for `bdlt&colon;&colon;Time` (00&colon;00&colon;00&period;000 &hyphen; 23&colon;59&colon;59&period;999, and 24&colon;00&colon;00&period;000)&period;
| xref:BloombergLP/bdlt/TimeUtil/convertToHHMM.adoc[`convertToHHMM`] 
| Return the non&hyphen;negative integer representing the same time as the specified `value` that, when expressed in decimal notation, contains exactly four digits (counting leading zeros, if any)&colon; two digits for the hour and two digits for the minute&period; For example, `Time(3, 9, sec, ms)`, where `0 &lt;&equals; sec &lt; 60` and `0 &lt;&equals; ms &lt; 1000`, is converted to 309&period; More formally, this method returns&colon; &grave; value&period;hour() &ast; 100 &plus; value&period;minute() &grave;
| xref:BloombergLP/bdlt/TimeUtil/convertToHHMMSS.adoc[`convertToHHMMSS`] 
| Return the non&hyphen;negative integer representing the same time as the specified `value` that, when expressed in decimal notation, contains exactly six digits (counting leading zeros, if any)&colon; two digits for the hour, two digits for the minute, and two digits for the second&period; For example, `Time(3, 9, 7, ms)`, where `0 &lt;&equals; ms &lt; 1000`, is converted to 30907&period; More formally, this method returns&colon; &grave; value&period;hour() &ast; 10000 &plus; value&period;minute() &ast; 100 &plus; value&period;second() &grave;
| xref:BloombergLP/bdlt/TimeUtil/convertToHHMMSSmmm.adoc[`convertToHHMMSSmmm`] 
| Return the non&hyphen;negative integer representing the same time as the specified `value` that, when expressed in decimal notation, contains exactly nine digits (counting leading zeros, if any)&colon; two digits for the hour, two digits for the minute, two digits for the second, and three digits for the millisecond&period; For example, `Time(3, 9, 7, 56)` is converted to 30907056&period; More formally, this method returns&colon; &grave; value&period;hour() &ast; 10000000 &plus; value&period;minute() &ast; 100000 &plus; value&period;second() &ast; 1000 &plus; value&period;millisecond() &grave;
| xref:BloombergLP/bdlt/TimeUtil/fromHms.adoc[`fromHms`] 
| Return an `optional` having a `Time` with the specified `hour`, `minute`, `second`, and the optionally specified `millisecond` and `microsecond`, if those form a valid `Time` (see `Time&colon;&colon;isValid`)&semi; otherwise return an `optional` without a value&period;
| xref:BloombergLP/bdlt/TimeUtil/isValidHHMM.adoc[`isValidHHMM`] 
| Return `true` if the specified `timeValue` is a non&hyphen;negative integer that represents a valid four&hyphen;digit time value suitable for passing to `convertFromHHMM`, and `false` otherwise&period; `timeValue` is a valid four&hyphen;digit time value if, when expressed in decimal notation, it contains exactly four digits (counting leading zeros, if any)&colon; two digits for the hour and two digits for the minute, where either `0 &lt;&equals; hour &lt; 24` and `0 &lt;&equals; minute &lt; 60`, or `2400 &equals;&equals; timeValue`&period;
| xref:BloombergLP/bdlt/TimeUtil/isValidHHMMSS.adoc[`isValidHHMMSS`] 
| Return `true` if the specified `timeValue` is a non&hyphen;negative integer that represents a valid six&hyphen;digit time value suitable for passing to `convertFromHHMMSS`, and `false` otherwise&period; `timeValue` is a valid six&hyphen;digit time value if, when expressed in decimal notation, it contains exactly six digits (counting leading zeros, if any)&colon; two digits for the hour, two digits for the minute, and two digits for the second, where either `0 &lt;&equals; hour &lt; 24`, `0 &lt;&equals; minute &lt; 60`, and `0 &lt;&equals; second &lt; 60`, or `240000 &equals;&equals; timeValue`&period;
| xref:BloombergLP/bdlt/TimeUtil/isValidHHMMSSmmm.adoc[`isValidHHMMSSmmm`] 
| Return `true` if the specified `timeValue` is a non&hyphen;negative integer that represents a valid nine&hyphen;digit time value suitable for passing to `convertFromHHMMSSmmm`, and `false` otherwise&period; `timeValue` is a valid nine&hyphen;digit time value if, when expressed in decimal notation, it contains exactly nine digits (counting leading zeros, if any)&colon; two digits for the hour, two digits for the minute, two digits for the second, and three digits for the millisecond, where either `0 &lt;&equals; hour &lt; 24`, `0 &lt;&equals; minute &lt; 60`, `0 &lt;&equals; second &lt; 60`, and `0 &lt;&equals; millisecond &lt; 1000`, or `240000000 &equals;&equals; timeValue`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
