39 p_tm.tm_mday = strtol(s, &nds, 10);
42 Oks::error_msg(
"oks::Time::Time()") <<
"failed to find the day in \'" << s2 <<
"\'\n";
48 if(
p_tm.tm_mday > 31 ||
p_tm.tm_mday == 0) {
49 Oks::error_msg(
"oks::Time::Time()") <<
"bad day " <<
p_tm.tm_mday <<
" in \'" << s2 <<
"\'\n";
56 p_tm.tm_mon = strtol(s, &nds, 10);
59 Oks::error_msg(
"oks::Time::Time()") <<
"failed to find the month in \'" << s2 <<
"\'\n";
65 if(
p_tm.tm_mon > 12 ||
p_tm.tm_mon == 0) {
66 Oks::error_msg(
"oks::Time::Time()") <<
"bad month " <<
p_tm.tm_mon <<
" in \'" << s2 <<
"\'\n";
75 p_tm.tm_year = strtol(s, &nds, 10);
77 if(
p_tm.tm_year >= 0) {
78 if(
p_tm.tm_year < 70)
p_tm.tm_year += 2000;
79 else if(
p_tm.tm_year < 100)
p_tm.tm_year += 1900;
97 p_tm.tm_hour = strtol(s, &nds, 10);
100 Oks::error_msg(
"oks::Time::Time()") <<
"failed to find the hour in \'" << s2 <<
"\'\n";
106 if(
p_tm.tm_hour > 23) {
107 Oks::error_msg(
"oks::Time::Time()") <<
"bad hour " <<
p_tm.tm_hour <<
" in \'" << s2 <<
"\'\n";
114 p_tm.tm_min = strtol(s, &nds, 10);
116 if(
p_tm.tm_min > 59) {
117 Oks::error_msg(
"oks::Time::Time()") <<
"bad minute " <<
p_tm.tm_min <<
" in \'" << s2 <<
"\'\n";
121 if(*nds !=
':')
return;
126 p_tm.tm_sec = strtol(nds + 1, &nds, 10);
128 if(
p_tm.tm_sec > 59) {
129 Oks::error_msg(
"oks::Time::Time()") <<
"bad second " <<
p_tm.tm_sec <<
" in \'" << s2 <<
"\'\n";