Problemer med tolkning af kode
Jeg skal have skrevet ud på min chart hvilken dato der læses fra og til. Dato og tid laves her, men hvad skal jeg skrive for at få fra dato start til dato slut.struct IsoTime {
// wday: 0=sunday, 1=monday,...,6=saturday
int year,month,mday,wday,hour,min,sec;
bool is_empty() { return year==0; }
void set_empty() { memset(this,0,sizeof(*this)); }
// Reads an ISO date.
char* from_str(const char*, bool allow_empty);
String to_str();
// Converts to other formats:
TDateTime toDate() { return EncodeDate(year,month,mday); }
TDateTime toTime() { return EncodeTime(hour,min,sec,0); }
// Conver from other formats:
void fromDate(TDateTime& t) { unsigned short y,m,d; t.DecodeDate(&y,&m,&d); year=y; month=m; mday=d; }
void fromTime(TDateTime& t) { Word h,m,s,i; t.DecodeTime(&h,&m,&s,&i); hour=h; min=m; sec=s; }
// Convert to ascii:
String toLocalStr(bool short_format) {
TDateTime time=toTime();
TDateTime date=toDate();
return time.TimeString()+" "+date.DateString();
}
};