File indexing completed on 2025-01-18 09:42:42
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_MYSQL_IMPL_DATETIME_IPP
0009 #define BOOST_MYSQL_IMPL_DATETIME_IPP
0010
0011 #pragma once
0012
0013 #include <boost/mysql/datetime.hpp>
0014
0015 #include <cstdio>
0016 #include <ostream>
0017
0018 std::ostream& boost::mysql::operator<<(std::ostream& os, const datetime& value)
0019 {
0020
0021 char buffer[64]{};
0022 snprintf(
0023 buffer,
0024 sizeof(buffer),
0025 "%04u-%02u-%02u %02d:%02u:%02u.%06u",
0026 static_cast<unsigned>(value.year()),
0027 static_cast<unsigned>(value.month()),
0028 static_cast<unsigned>(value.day()),
0029 static_cast<unsigned>(value.hour()),
0030 static_cast<unsigned>(value.minute()),
0031 static_cast<unsigned>(value.second()),
0032 static_cast<unsigned>(value.microsecond())
0033 );
0034 os << buffer;
0035 return os;
0036 }
0037
0038 #endif