Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
ole_automation_conversions.hpp File Reference

OLE Automation Date (OA date) conversions. More...

Go to the source code of this file.

Namespaces

namespace  time_shield
 Main namespace for the Time Shield library.
 

Functions

TIME_SHIELD_CONSTEXPR oadate_t time_shield::ts_to_oadate (ts_t ts) noexcept
 Convert Unix timestamp (seconds) to OA date.
 
TIME_SHIELD_CONSTEXPR oadate_t time_shield::fts_to_oadate (fts_t ts) noexcept
 Convert Unix timestamp (floating seconds) to OA date.
 
TIME_SHIELD_CONSTEXPR oadate_t time_shield::ts_ms_to_oadate (ts_ms_t ts_ms) noexcept
 Convert Unix timestamp (milliseconds) to OA date.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::oadate_to_ts (oadate_t oa) noexcept
 Convert OA date to Unix timestamp (seconds).
 
TIME_SHIELD_CONSTEXPR fts_t time_shield::oadate_to_fts (oadate_t oa) noexcept
 Convert OA date to Unix timestamp (floating seconds).
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::oadate_to_ts_ms (oadate_t oa) noexcept
 Convert OA date to Unix timestamp (milliseconds).
 
template<class T1, class T2, class T3>
TIME_SHIELD_CONSTEXPR oadate_t time_shield::to_oadate (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T3 ms=0) noexcept
 Build OA date from calendar components (Gregorian).
 

Detailed Description

OLE Automation Date (OA date) conversions.

OA date is a floating-point day count where:

  • 0.0 is 1899-12-30 00:00:00
  • the integer part is days offset from that date
  • the fractional part is time-of-day / 24

This header provides conversions between OA date and:

  • Unix timestamps in seconds (ts_t)
  • Unix timestamps in milliseconds (ts_ms_t)
  • floating seconds (fts_t)

Definition in file ole_automation_conversions.hpp.