[#BloombergLP-balber-BerUtil_DateImpUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balber.adoc[balber]::BerUtil&lowbar;DateImpUtil
:relfileprefix: ../../
:mrdocs:

Utilities for BER date encoding and decoding&period;

== Synopsis

Declared in `&lt;balber&lowbar;berutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct BerUtil&lowbar;DateImpUtil;
----

== Description

This component&hyphen;private `struct` provides a namespace for a suite of functions used by `BerUtil` to implement BER encoding and decoding operations for date values&period; Within the definition of this `struct`&colon;

&ast; *the specification*&colon; &gt; Refers to the August 2015 revision of the ITU&hyphen;T Recommendation X&period;690&period;

&ast; *the default set of options*&colon; &gt; Refers to a `balber&colon;&colon;BerEncoderOptions` value having a &gt; `datetimeFractionalSecondPrecision` attribute of 3 and a &gt; `encodeDateAndTimeTypesAsBinary` attribute of `false`&period;

See the package level documentation of `balber` for a definition of the compact and extended binary formats for date and time values&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil_DateImpUtil/DateAndTimeHeaderUtil.adoc[`DateAndTimeHeaderUtil`] 
| Alias for extended&hyphen;binary date&hyphen;and&hyphen;time header utilities&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/DateEncoding.adoc[`DateEncoding`] 
| `DateEncoding` is an alias to a namespace for enumerating the set of formats that may be used by `BerUtil` to encode and decode values of `bdlt&colon;&colon;Date` type&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/DateOrDateTz.adoc[`DateOrDateTz`] 
| `DateOrDateTz` is a convenient alias for `bdlb&colon;&colon;Variant2&lt;bdlt&colon;&colon;Date, bdlt&colon;&colon;DateTz&gt;`&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/DateOrDateTzEncoding.adoc[`DateOrDateTzEncoding`] 
| Alias for date&hyphen;or&hyphen;date&hyphen;tz encoding format enumerations&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/DateTzEncoding.adoc[`DateTzEncoding`] 
| `DateEncoding` is an alias to a namespace for enumerating the set of formats that may be used by `BerUtil` to encode and decode values of `bdlt&colon;&colon;DateTz` type&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/IntegerUtil.adoc[`IntegerUtil`] 
| `IntegerUtil` is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for integer values&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/Iso8601Util.adoc[`Iso8601Util`] 
| Alias for ISO 8601 date and time encoding utilities&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/LengthUtil.adoc[`LengthUtil`] 
| `LengthUtil` is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for length quantities&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/StreambufUtil.adoc[`StreambufUtil`] 
| `StreambufUtil` is an alias to a namespace for a suite of functions used to implement input and output operations on `bsl&colon;&colon;streambuf` objects&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/StringUtil.adoc[`StringUtil`] 
| `StringUtil` is an alias to a namespace for a suite of functions used by `BerUtil` to implement BER encoding and decoding operations for string values&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/TimezoneUtil.adoc[`TimezoneUtil`] 
| `TimezoneUtil` is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for time&hyphen;zone offset values&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil_DateImpUtil/_04enum.adoc[`Unnamed enum`] 
| Epoch constants for compact&hyphen;binary date encoding&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil_DateImpUtil/dateToDaysSinceEpoch.adoc[`dateToDaysSinceEpoch`] 
| Convert a date to days relative to the compact&hyphen;binary date epoch&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/daysSinceEpochToDate.adoc[`daysSinceEpochToDate`] 
| Load to the specified `date` the date represented by the serial date indicated by adding the specified `daysSinceEpoch` to `k&lowbar;COMPACT&lowbar;BINARY&lowbar;DATE&lowbar;EPOCH`&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/getDateOrDateTzValue.adoc[`getDateOrDateTzValue`] 
| Read the specified `length` number of bytes from the input sequence of the specified `streamBuf` and load to the specified `value` the date and optional time&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/getDateTzValue.adoc[`getDateTzValue`] 
| Decode a `bdlt&colon;&colon;DateTz` value from `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/getDateValue.adoc[`getDateValue`] 
| Decode a `bdlt&colon;&colon;Date` value from `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/putDateTzValue.adoc[`putDateTzValue`] 
| Encode a `bdlt&colon;&colon;DateTz` value to `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil_DateImpUtil/putDateValue.adoc[`putDateValue`] 
| Encode a `bdlt&colon;&colon;Date` value to `streamBuf`&period;
|===



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