How can i interpret “FoxPro” dbf file date time field (eight-byte) in my c++ program?

大憨熊 提交于 2020-01-15 11:14:12

问题


I am writing a c++ program to read DBF file of foxpro database .I stumbled upon this date time field of eight bytes.How can i interpret it ? Any help would be highly appreciated ?


回答1:


The value is a double

The integer part is the day since 1899/12/30

internal const double JulianDay_1899_12_30 = 2415019.0;

double d = theValue;

in c#

return DateTime.FromOADate(d - JulianDay_1899_12_30);

see http://msdn.microsoft.com/en-us/library/system.datetime.fromoadate.aspx



来源:https://stackoverflow.com/questions/23577409/how-can-i-interpret-foxpro-dbf-file-date-time-field-eight-byte-in-my-c-pro

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!