c++ - 在 C++ 中读取、操作和写入 SQLServer DateTimeOffset 字段

标签 c++ sql-server datetime

SQLServer 2008 引入了一个非常受欢迎的 DateTimeOffset field type .

.Net 3.5 以上的版本引入了相应的 DateTimeOffset structure .

我想知道如何在 C++ 中操作同一个字段。 documentation for CDBVariant不讨论 DateTimeOffset。

如何在 C++ 中操作 DateTimeOffsets?

最佳答案

我认为this MSDN 页面可能对您有用。它包括一个关于如何使用新的日期/时间结构的 C++ 示例。从页面描述:

This sample shows how to initialize the date/time data structures that were added in SQL Server 2008. It then prepares the input values, binds parameters, and executes the query. For more information about using these types, see Date/Time Improvements (ODBC).

关于c++ - 在 C++ 中读取、操作和写入 SQLServer DateTimeOffset 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17280389/

相关文章:

c++ - QString从列表中解析项目

sql - 删除所有空格并在SQL中将多行合并为单行

datetime - 当时间以 UNIX 时间戳形式给出并添加毫秒时,我可以绘制时间吗?

javascript - ISO 格式 "+00:00"和 "Z"之间的区别?

java - 无法使用 Java 8 将给定的本地日期转换为 GMT 日期

c++ - 如何保持文件中变量的最新值?

c++ - 为什么代码覆盖率报告说我的库没有被覆盖?

c++ - 生成MITK教程错误

sql-server - 使用 SQL Server 比较日期

mysql - 用于 MS SQL 到 SQL 数据迁移的开源工具(不同架构)