尝试转换旧的Borland代码. [英] Trying to convert old Borland code.

查看:66
本文介绍了尝试转换旧的Borland代码.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是转换使用Borland C ++ Builder创建的旧代码,并创建一些我们可以再次使用的代码.我认为我基本上是在正确的道路上,除了我坚持使用某些表格材料.

I''ve been tasked with converting old code created using Borland C++ Builder and creating something we can use again. I think I''m mostly on the right track except I''m stuck with some of the form stuff.

double startTime = (int)(Form1->DatePickerStart->Date.Val) + Form1->ExtractDays(Form1->TimeEditStart->Text);



我很难弄清楚这双的样子.我只是尝试约会,然后将其转换为刻度,但这没有用.

任何人都可以阅读吗?

DatePickerStart只是日历日期选择器,而Time Edit Start只是时间选择器.但是对我来说,将日期转换为整数,然后将转换为天的时间加起来并使其变成双精度,这对我来说很奇怪,我不能仅仅想象这在创造什么.我认为



I''m having trouble figuring out what this double will look like. I tried just taking a date time and converting it to ticks but that didn''t work.

Can anyone read this?

DatePickerStart is just a calendar date picker, and Time Edit Start is just a time selector. But converting the date to an int and adding the time converted to days and making it a double seems weird to me and I can''t just picture what this is creating. An example would be helpful I think

推荐答案



自从我使用Borland编译器以来已经有很长时间了,但是我相信从日期选择器返回的双精度值与 ^ ].

最好的祝福,
-David Delaune
Hi,

It has been a long time since I used the Borland compiler but I believe the double returned from the date picker was identical to the double within the COleDateTime[^].

Best Wishes,
-David Delaune


转换为time_t(unix时间)

http://msdn.microsoft.com/en-us/library/w4ddyt9h (v = vs.80).aspx [
To convert to time_t (unix time)

http://msdn.microsoft.com/en-us/library/w4ddyt9h(v=vs.80).aspx[^]


TDateTime BorlandTime = somevalue;

time_t time_t_time = round((BorlandTime - 25569.0) * 86400);



25569设置为Unix时代1970年1月1日
86400 ==一天中的秒数



25569 sets to Unix epoch 1/1/1970
86400 == seconds in day


如果它创建了一个double,请尝试将其转换回日期时间,看看结果是否符合您的期望.调试器将在这里派上用场.
If it created a double, try converting that back into a datetime and see if the result is what you expect. The debugger will come in handy here.


这篇关于尝试转换旧的Borland代码.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆