+void DateTime::init(const TimeStamp &ts)
+{
+ year = 1970;
+ month = 1;
+ mday = 1;
+ hour = 0;
+ minute = 0;
+ second = 0;
+ usec = 0;
+ add_raw(ts.raw());
+}
+
+void DateTime::init(int y, unsigned char m, unsigned char d, unsigned char h, unsigned char n, unsigned char s, unsigned u)
+{
+ year = y;
+ month = m;
+ mday = d;
+ hour = h;
+ minute = n;
+ second = s;
+ usec = u;
+
+ if(usec>=1000000)
+ throw out_of_range("DateTime::DateTime usec");
+ if(second>=60)
+ throw out_of_range("DateTime::DateTime second");
+ if(minute>=60)
+ throw out_of_range("DateTime::DateTime minute");
+ if(hour>=24)
+ throw out_of_range("DateTime::DateTime hour");
+ if(month<1 || month>12)
+ throw out_of_range("DateTime::DateTime month");
+ if(mday<1 || mday>month_days(year, month))
+ throw out_of_range("DateTime::DateTime mday");
+}
+