用COleDateTime保存的长整型数在VB.net或C#中转换为日期?

袁志胜 2021-04-24 09:15:08
有这么一个场景:
使用VC开发的软件将日期用长整型数保存到文件中,现在想用VB.net或C#中读取并转换为日期字符串。
VC中是用COleDateTime类保存的。
请教各位大神,我该如何处理呢?
...全文
665 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2021-04-25
  • 打赏
  • 举报
回复
仅供参考: COleDateTime::m_dt Remarks The underlying DATE structure for this COleDateTime object. Caution Changing the value in the DATE object accessed by the pointer returned by this function will change the value of this COleDateTime object. It does not change the status of this COleDateTime object. For more information about the implementation of the DATE object, see the articleDate and Time: Automation Support in Visual C++ Programmer’s Guide. COleDateTime Overview | Class Members | Hierarchy Chart See Also COleDateTime::COleDateTime, COleDateTime::SetDateTime, COleDateTime::SetDate, COleDateTime::SetTime, COleDateTime::operator DATE -------------------------------------------------------------------------------- Send feedback to MSDN.Look here for MSDN Online resources. The DATE Type Home | Overview | How Do I The DATE type is implemented using an 8-byte floating-point number. Days are represented by whole number increments starting with 30 December 1899, midnight as time zero. Hour values are expressed as the absolute value of the fractional part of the number. The following table illustrates this. Date and time Representation 30 December 1899, midnight 0.00 1 January 1900, midnight 2.00 4 January 1900, midnight 5.00 4 January 1900, 6 A.M. 5.25 4 January 1900, noon 5.50 4 January 1900, 9 P.M. 5.875 So, the DATE date type, and also the COleDateTime class, represent dates and times as a classic number line. However, there are discontinuities for dates before 30 December 1899. See the following table for an illustration. Date and time Representation 30 December 1899, midnight 0.00 29 December 1899, midnight -1.00 18 December 1899, midnight -12.00 18 December 1899, 6 A.M. -12.25 18 December 1899, noon -12.50 18 December 1899, 6 P.M. -12.75 19 December 1899, midnight -11.00 -------------------------------------------------------------------------------- Send feedback to MSDN.Look here for MSDN Online resources. COleDateTime::m_status Remarks The type of this data member is the enumerated type DateTimeStatus, which is defined within the COleDateTime class. enum DateTimeStatus{ valid = 0, invalid = 1, null = 2, }; For a brief description of these status values, see the following list: COleDateTime::valid Indicates that this COleDateTime object is valid. COleDateTime::invalid Indicates that this COleDateTime object is invalid; that is, its value may be incorrect. COleDateTime::null Indicates that this COleDateTime object is null, that is, that no value has been supplied for this object. (This is “null” in the database sense of “having no value,” as opposed to the C++ NULL.) The status of a COleDateTime object is invalid in the following cases: If its value is set from a VARIANT or COleVariant value that could not be converted to a date/time value. If its value is set from a time_t, SYSTEMTIME, or FILETIME value that could not be converted to a valid date/time value. If its value is set by SetDateTime with invalid parameter values. If this object has experienced an overflow or underflow during an arithmetic assignment operation, namely, += or -=. If an invalid value was assigned to this object. If the status of this object was explicitly set to invalid using SetStatus. For more information about the operations that may set the status to invalid, see the following member functions: COleDateTime SetDateTime operator +, - operator +=, -= Caution This data member is for advanced programming situations. You should use the inline member functions GetStatus and SetStatus. See SetStatus for further cautions regarding explicitly setting this data member. For more information about the bounds for COleDateTime values, see the articleDate and Time: Automation Support in Visual C++ Programmer’s Guide. COleDateTime Overview | Class Members | Hierarchy Chart See Also COleDateTime::GetStatus, COleDateTime::SetStatus -------------------------------------------------------------------------------- Send feedback to MSDN.Look here for MSDN Online resources.
内容概要:本文围绕“基于超局部模型与自抗扰ESO观测器的无模型预测电流控制改进策略”展开研究,提出一种结合超局部模型(ULM)与扩张状态观测器(ESO)的无模型预测电流控制(MFPCC)改进方法,旨在提升永磁同步电机(PMSM)电流环的动态响应性能与抗干扰能力。该策略利用超局部模型对系统行为进行局部逼近,避免依赖精确数学模型,同时引入自抗扰控制的ESO实时观测并补偿系统内外部扰动,有效抑制参数摄动、负载变化及模型不确定性带来的影响。研究通过Simulink搭建完整的控制系统仿真模型,对传统MFPCC与所提改进策略进行对比分析,验证了新方法在电流跟踪精度、响应速度和鲁棒性方面的优越性。; 适合人群:具备电机控制、现代控制理论及Simulink仿真基础的电气工程、自动化及相关专业的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于高性能电机驱动系统电流环控制器的设计与优化;②为无模型控制与自抗扰控制的融合应用提供技术参考;③支撑相关课题的仿真验证、论文复现与创新方法研究。; 阅读建议:建议读者结合Simulink仿真模型深入理解控制结构与参数整定过程,重点关注ESO的观测性能与扰动补偿机制,并可通过改变负载条件、参数偏差等工况进行鲁棒性测试,进一步掌握该改进策略的核心优势与适用边界。

1,488

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧