1#ifndef OPENXLSX_XLDATETIME_HPP
2#define OPENXLSX_XLDATETIME_HPP
6# pragma warning(disable : 4251)
7# pragma warning(disable : 4275)
16#include "OpenXLSX-Exports.hpp"
57 explicit XLDateTime(
const std::chrono::system_clock::time_point& timepoint);
78 [[nodiscard]]
static XLDateTime fromString(
const std::string& dateString,
const std::string& format =
"%Y-%m-%d %H:%M:%S");
84 [[nodiscard]] std::string
toString(
const std::string& format =
"%Y-%m-%d %H:%M:%S")
const;
94 XLDateTime& operator=(
const std::tm& timepoint);
100 template<
typename T,
typename = std::enable_if_t<std::is_
floating_po
int_v<T>>>
102 {
return static_cast<T
>(serial()); }
107 operator std::tm()
const;
112 [[nodiscard]] std::chrono::system_clock::time_point chrono()
const;
117 [[nodiscard]]
double serial()
const;
124 [[nodiscard]] std::tm tm()
const;
127 double m_serial{1.0};
Manages date and time values according to the Excel 1900 date system.
Definition XLDateTime.hpp:30
XLDateTime(const XLDateTime &other)=default
XLDateTime(XLDateTime &&other) noexcept=default
XLDateTime()
Constructs an object representing the Excel epoch (1900-01-01).
XLDateTime & operator=(XLDateTime &&other) noexcept=default
XLDateTime & operator=(const XLDateTime &other)=default
Definition IZipArchive.hpp:18
std::string toString(const XLCellValue &v)
Definition XLFormulaUtils.cpp:29