以c+形式传递日期+; 我需要通过C++中的DATETIME值。(为AmiBroker创建插件)
我必须把它传给Midate 我有一个长变量的日期。(1980年1月1日午夜后的秒数) 目标结构定义如下以c+形式传递日期+; 我需要通过C++中的DATETIME值。(为AmiBroker创建插件),c++,C++,我必须把它传给Midate 我有一个长变量的日期。(1980年1月1日午夜后的秒数) 目标结构定义如下 // 8 byte (64 bit) date time stamp union AmiDate { DATE_TIME_INT Date; struct PackedDate PackDate; }; struct PackedDate { // lower 32 bits unsigned int IsFuturePad:1; // bit
// 8 byte (64 bit) date time stamp
union AmiDate
{
DATE_TIME_INT Date;
struct PackedDate PackDate;
};
struct PackedDate {
// lower 32 bits
unsigned int IsFuturePad:1; // bit marking "future data"
unsigned int Reserved:5; // reserved set to zero
unsigned int MicroSec:10; // microseconds 0..999
unsigned int MilliSec:10; // milliseconds 0..999
unsigned int Second: 6; // 0..59
// higher 32 bits
unsigned int Minute : 6; // 0..59 63 is reserved as EOD marker
unsigned int Hour : 5; // 0..23 31 is reserved as EOD marker
unsigned int Day : 5; // 1..31
unsigned int Month : 4; // 1..12
unsigned int Year : 12; // 0..4095
};
没有找到线索 一个选项是将C时间库用作:
#包括
time_t numSeconds=/*您的值*/;
//此结构包含时间的分解组件。
结构tm*时间信息;
//通过调用localtime填充结构。
timeinfo=localtime(&numSeconds);
现在,您可以从刚刚填充的对象中提取组件,并使用它填充
AmiDate
对象。我认为您不能使用AmiDate将任何内容从AFL传递到DLL
酰胺结构仅在DLL内部使用,只是像GetStockArray()一样的函数(也在DLL内部使用)用于检索每个BarIndex的O、H、L、C、V
除了使用GetDateTimeArray()函数解码每个BarIndex的日期时间之外您想做什么?想把酰胺传递到某个功能上吗?还是想把一些STDLIB的时间转换成AMI?我怎么能通过这个日期?我想把我的日期值(存储在UITT)传递给AmiDateTo,更好地制定一个有针对性的答案,你能告诉我们C++有多少经验吗?我用c#来代替。。。
#include <ctime>
time_t numSeconds = /* your value */;
// this structure contains the broken down components of the time.
struct tm * timeinfo;
// fill in the struct by calling localtime.
timeinfo = localtime ( &numSeconds);