Lines Matching refs:time

94time->have_time) { add_error(s, TIMELIB_ERR_DOUBLE_TIME, "Double time specification"); timelib_str…
95 #define TIMELIB_UNHAVE_TIME() { s->time->have_time = 0; s->time->h = 0; s->time->i = 0; s->time->s …
96 …>time->have_date) { add_error(s, TIMELIB_ERR_DOUBLE_DATE, "Double date specification"); timelib_st…
97 #define TIMELIB_UNHAVE_DATE() { s->time->have_date = 0; s->time->d = 0; s->time->m = 0; s->time->y …
98 #define TIMELIB_HAVE_RELATIVE() { s->time->have_relative = 1; }
99 #define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_weekda…
100 #define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_relative = 1; s->time->relative.have_specia…
101time->have_zone) { s->time->have_zone > 1 ? add_error(s, TIMELIB_ERR_DOUBLE_TZ, "Double timezone s…
105 #define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { i…
138 timelib_time *time;
644 * the time portion should not be reset to midnight, or
646 * for not overwriting the time portion for 'X weekday'.
657 case TIMELIB_MICROSEC: s->time->relative.us += amount * relunit->multiplier; break;
658 case TIMELIB_SECOND: s->time->relative.s += amount * relunit->multiplier; break;
659 case TIMELIB_MINUTE: s->time->relative.i += amount * relunit->multiplier; break;
660 case TIMELIB_HOUR: s->time->relative.h += amount * relunit->multiplier; break;
661 case TIMELIB_DAY: s->time->relative.d += amount * relunit->multiplier; break;
662 case TIMELIB_MONTH: s->time->relative.m += amount * relunit->multiplier; break;
663 case TIMELIB_YEAR: s->time->relative.y += amount * relunit->multiplier; break;
670 s->time->relative.d += (amount > 0 ? amount - 1 : amount) * 7;
671 s->time->relative.weekday = relunit->multiplier;
672 s->time->relative.weekday_behavior = behavior;
680 s->time->relative.special.type = relunit->multiplier;
681 s->time->relative.special.amount = amount;
1048 s->time->relative.d = -1;
1068 s->time->h = 12;
1091 s->time->relative.d = 1;
1107 s->time->y = 1970;
1108 s->time->m = 1;
1109 s->time->d = 1;
1110 s->time->h = s->time->i = s->time->s = 0;
1111 s->time->us = 0;
1112 s->time->relative.s += i;
1113 s->time->is_localtime = 1;
1114 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1115 s->time->z = 0;
1116 s->time->dst = 0;
1139 s->time->y = 1970;
1140 s->time->m = 1;
1141 s->time->d = 1;
1142 s->time->h = s->time->i = s->time->s = 0;
1143 s->time->us = 0;
1144 s->time->relative.s += i;
1145 s->time->relative.us = us;
1146 s->time->is_localtime = 1;
1147 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
1148 s->time->z = 0;
1149 s->time->dst = 0;
1163 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
1165 s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
1180 s->time->h = timelib_get_nr(&ptr, 2);
1181 s->time->i = 15;
1183 s->time->h = timelib_get_nr(&ptr, 2) - 1;
1184 s->time->i = 45;
1188 s->time->h += timelib_meridian(&ptr, s->time->h);
1207 s->time->relative.special.type = TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH;
1210 s->time->relative.special.type = TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH;
1222 s->time->h = timelib_get_nr(&ptr, 2);
1224 s->time->i = timelib_get_nr(&ptr, 2);
1226 s->time->s = timelib_get_nr(&ptr, 2);
1229 s->time->h += timelib_meridian(&ptr, s->time->h);
1239 s->time->h = timelib_get_nr(&ptr, 2);
1240 s->time->i = timelib_get_nr(&ptr, 2);
1242 s->time->s = timelib_get_nr(&ptr, 2);
1245 s->time->us = timelib_get_frac_nr(&ptr);
1249 s->time->h += timelib_meridian(&ptr, s->time->h);
1260 s->time->h = timelib_get_nr(&ptr, 2);
1261 s->time->i = timelib_get_nr(&ptr, 2);
1263 s->time->s = timelib_get_nr(&ptr, 2);
1266 s->time->us = timelib_get_frac_nr(&ptr);
1271 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1284 switch (s->time->have_time) {
1286 s->time->h = timelib_get_nr(&ptr, 2);
1287 s->time->i = timelib_get_nr(&ptr, 2);
1288 s->time->s = 0;
1291 s->time->y = timelib_get_nr(&ptr, 4);
1295 add_error(s, TIMELIB_ERR_DOUBLE_TIME, "Double time specification");
1298 s->time->have_time++;
1307 switch (s->time->have_time) {
1309 s->time->h = timelib_get_nr(&ptr, 2);
1310 s->time->i = timelib_get_nr(&ptr, 2);
1311 s->time->s = 0;
1312 s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
1315 s->time->y = timelib_get_nr(&ptr, 4);
1321 s->time->have_time++;
1332 s->time->h = timelib_get_nr(&ptr, 2);
1333 s->time->i = timelib_get_nr(&ptr, 2);
1334 s->time->s = timelib_get_nr(&ptr, 2);
1337 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1352 s->time->m = timelib_get_nr(&ptr, 2);
1353 s->time->d = timelib_get_nr(&ptr, 2);
1355 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1356 TIMELIB_PROCESS_YEAR(s->time->y, length);
1367 s->time->y = timelib_get_signed_nr(s, &ptr, 4);
1368 s->time->m = timelib_get_nr(&ptr, 2);
1369 s->time->d = timelib_get_nr(&ptr, 2);
1380 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1381 s->time->m = timelib_get_nr(&ptr, 2);
1382 s->time->d = timelib_get_nr(&ptr, 2);
1383 TIMELIB_PROCESS_YEAR(s->time->y, length);
1393 s->time->y = timelib_get_signed_nr(s, &ptr, 19);
1394 s->time->m = timelib_get_nr(&ptr, 2);
1395 s->time->d = timelib_get_nr(&ptr, 2);
1406 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1407 s->time->m = timelib_get_nr(&ptr, 2);
1408 s->time->d = 1;
1409 TIMELIB_PROCESS_YEAR(s->time->y, length);
1420 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1421 s->time->m = timelib_get_nr(&ptr, 2);
1422 s->time->d = timelib_get_nr(&ptr, 2);
1423 TIMELIB_PROCESS_YEAR(s->time->y, length);
1434 s->time->d = timelib_get_nr(&ptr, 2);
1436 s->time->m = timelib_get_month(&ptr);
1437 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1438 TIMELIB_PROCESS_YEAR(s->time->y, length);
1448 s->time->d = timelib_get_nr(&ptr, 2);
1449 s->time->m = timelib_get_nr(&ptr, 2);
1450 s->time->y = timelib_get_nr(&ptr, 4);
1461 s->time->d = timelib_get_nr(&ptr, 2);
1462 s->time->m = timelib_get_nr(&ptr, 2);
1463 s->time->y = timelib_get_nr_ex(&ptr, 2, &length);
1464 TIMELIB_PROCESS_YEAR(s->time->y, length);
1475 s->time->m = timelib_get_month(&ptr);
1476 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1477 s->time->d = 1;
1478 TIMELIB_PROCESS_YEAR(s->time->y, length);
1489 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1490 s->time->m = timelib_get_month(&ptr);
1491 s->time->d = 1;
1492 TIMELIB_PROCESS_YEAR(s->time->y, length);
1503 s->time->m = timelib_get_month(&ptr);
1504 s->time->d = timelib_get_nr(&ptr, 2);
1505 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1506 TIMELIB_PROCESS_YEAR(s->time->y, length);
1516 s->time->d = timelib_get_nr(&ptr, 2);
1518 s->time->m = timelib_get_month(&ptr);
1528 s->time->y = timelib_get_nr(&ptr, 4);
1529 s->time->m = timelib_get_nr(&ptr, 2);
1530 s->time->d = timelib_get_nr(&ptr, 2);
1542 s->time->y = timelib_get_nr(&ptr, 4);
1543 s->time->m = timelib_get_nr(&ptr, 2);
1544 s->time->d = timelib_get_nr(&ptr, 2);
1545 s->time->h = timelib_get_nr(&ptr, 2);
1546 s->time->i = timelib_get_nr(&ptr, 2);
1547 s->time->s = timelib_get_nr(&ptr, 2);
1549 s->time->us = timelib_get_frac_nr(&ptr);
1551 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1567 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1568 s->time->d = timelib_get_nr(&ptr, 3);
1569 s->time->m = 1;
1570 TIMELIB_PROCESS_YEAR(s->time->y, length);
1583 s->time->y = timelib_get_nr(&ptr, 4);
1586 s->time->m = 1;
1587 s->time->d = 1;
1588 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1602 s->time->y = timelib_get_nr(&ptr, 4);
1605 s->time->m = 1;
1606 s->time->d = 1;
1607 s->time->relative.d = timelib_daynr_from_weeknr(s->time->y, w, d);
1619 s->time->m = timelib_get_month(&ptr);
1620 s->time->d = timelib_get_nr(&ptr, 2);
1621 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1622 TIMELIB_PROCESS_YEAR(s->time->y, length);
1633 s->time->y = timelib_get_nr_ex(&ptr, 4, &length);
1634 s->time->m = timelib_get_month(&ptr);
1635 s->time->d = timelib_get_nr(&ptr, 2);
1636 TIMELIB_PROCESS_YEAR(s->time->y, length);
1648 s->time->d = timelib_get_nr(&ptr, 2);
1649 s->time->m = timelib_get_month(&ptr);
1650 s->time->y = timelib_get_nr(&ptr, 4);
1651 s->time->h = timelib_get_nr(&ptr, 2);
1652 s->time->i = timelib_get_nr(&ptr, 2);
1653 s->time->s = timelib_get_nr(&ptr, 2);
1654 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1666 s->time->y = timelib_get_nr(&ptr, 4);
1675 s->time->relative.y = 0 - s->time->relative.y;
1676 s->time->relative.m = 0 - s->time->relative.m;
1677 s->time->relative.d = 0 - s->time->relative.d;
1678 s->time->relative.h = 0 - s->time->relative.h;
1679 s->time->relative.i = 0 - s->time->relative.i;
1680 s->time->relative.s = 0 - s->time->relative.s;
1681 s->time->relative.weekday = 0 - s->time->relative.weekday;
1682 if (s->time->relative.weekday == 0) {
1683 s->time->relative.weekday = -7;
1685 …if (s->time->relative.have_special_relative && s->time->relative.special.type == TIMELIB_SPECIAL_W…
1686 s->time->relative.special.amount = 0 - s->time->relative.special.amount;
1701 s->time->relative.weekday = relunit->multiplier;
1702 if (s->time->relative.weekday_behavior != 2) {
1703 s->time->relative.weekday_behavior = 1;
1722 s->time->relative.weekday_behavior = 2;
1725 if (s->time->relative.have_weekday_relative == 0) {
1727 s->time->relative.weekday = 1;
1756 s->time->m = timelib_lookup_month(&ptr);
1767 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1780 s->time->m = timelib_get_month(&ptr);
1781 s->time->d = timelib_get_nr(&ptr, 2);
1784 s->time->h = timelib_get_nr(&ptr, 2);
1785 s->time->i = timelib_get_nr(&ptr, 2);
1787 s->time->s = timelib_get_nr(&ptr, 2);
1790 s->time->us = timelib_get_frac_nr(&ptr);
1794 s->time->h += timelib_meridian(&ptr, s->time->h);
1805 s->time->m = timelib_get_month(&ptr);
1806 s->time->d = timelib_get_nr(&ptr, 2);
1809 s->time->h = timelib_get_nr(&ptr, 2);
1810 s->time->i = timelib_get_nr(&ptr, 2);
1812 s->time->s = timelib_get_nr(&ptr, 2);
1815 s->time->us = timelib_get_frac_nr(&ptr);
1820 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
1888 in.time = timelib_time_ctor();
1895 …in.time->y = in.time->d = in.time->m = in.time->h = in.time->i = in.time->s = in.time->us = in.tim…
1896 in.time->is_localtime = in.time->zone_type = 0;
1897 return in.time;
1906 in.time = timelib_time_ctor();
1907 in.time->y = TIMELIB_UNSET;
1908 in.time->d = TIMELIB_UNSET;
1909 in.time->m = TIMELIB_UNSET;
1910 in.time->h = TIMELIB_UNSET;
1911 in.time->i = TIMELIB_UNSET;
1912 in.time->s = TIMELIB_UNSET;
1913 in.time->us = TIMELIB_UNSET;
1914 in.time->z = TIMELIB_UNSET;
1915 in.time->dst = TIMELIB_UNSET;
1917 in.time->is_localtime = 0;
1918 in.time->zone_type = 0;
1919 in.time->relative.days = TIMELIB_UNSET;
1928 /* do funky checking whether the parsed time was valid time */
1929 if (in.time->have_time && !timelib_valid_time( in.time->h, in.time->i, in.time->s)) {
1930 add_warning(&in, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid");
1933 if (in.time->have_date && !timelib_valid_date( in.time->y, in.time->m, in.time->d)) {
1943 return in.time;
1957 static void timelib_time_reset_fields(timelib_time *time)
1959 assert(time != NULL);
1961 time->y = 1970;
1962 time->m = 1;
1963 time->d = 1;
1964 time->h = time->i = time->s = 0;
1965 time->us = 0;
1966 time->tz_info = NULL;
1969 static void timelib_time_reset_unset_fields(timelib_time *time)
1971 assert(time != NULL);
1973 if (time->y == TIMELIB_UNSET ) time->y = 1970;
1974 if (time->m == TIMELIB_UNSET ) time->m = 1;
1975 if (time->d == TIMELIB_UNSET ) time->d = 1;
1976 if (time->h == TIMELIB_UNSET ) time->h = 0;
1977 if (time->i == TIMELIB_UNSET ) time->i = 0;
1978 if (time->s == TIMELIB_UNSET ) time->s = 0;
1979 if (time->us == TIMELIB_UNSET ) time->us = 0;
2075 in.time = timelib_time_ctor();
2076 in.time->y = TIMELIB_UNSET;
2077 in.time->d = TIMELIB_UNSET;
2078 in.time->m = TIMELIB_UNSET;
2079 in.time->h = TIMELIB_UNSET;
2080 in.time->i = TIMELIB_UNSET;
2081 in.time->s = TIMELIB_UNSET;
2082 in.time->us = TIMELIB_UNSET;
2083 in.time->z = TIMELIB_UNSET;
2084 in.time->dst = TIMELIB_UNSET;
2086 in.time->is_localtime = 0;
2087 in.time->zone_type = 0;
2135 in.time->have_relative = 1;
2136 in.time->relative.have_weekday_relative = 1;
2137 in.time->relative.weekday = tmprel->multiplier;
2138 in.time->relative.weekday_behavior = 1;
2145 if ((s->time->d = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2150 s->time->have_date = 1;
2157 if (s->time->y == TIMELIB_UNSET) {
2165 if (s->time->y != TIMELIB_UNSET) {
2166 s->time->have_date = 1;
2167 s->time->m = 1;
2168 s->time->d = tmp + 1;
2169 timelib_do_normalize(s->time);
2176 if ((s->time->m = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2180 s->time->have_date = 1;
2190 s->time->have_date = 1;
2191 s->time->m = tmp;
2197 if ((s->time->y = timelib_get_nr_ex(&ptr, 2, &length)) == TIMELIB_UNSET) {
2202 s->time->have_date = 1;
2203 TIMELIB_PROCESS_YEAR(s->time->y, length);
2208 if ((s->time->y = timelib_get_nr(&ptr, 4)) == TIMELIB_UNSET) {
2213 s->time->have_date = 1;
2218 if ((s->time->h = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2222 if (s->time->h > 12) {
2227 s->time->have_time = 1;
2232 if ((s->time->h = timelib_get_nr(&ptr, 2)) == TIMELIB_UNSET) {
2237 s->time->have_time = 1;
2240 if (s->time->h == TIMELIB_UNSET) {
2243 if ((tmp = timelib_meridian_with_check(&ptr, s->time->h)) == TIMELIB_UNSET) {
2248 s->time->have_time = 1;
2249 if (s->time->h != TIMELIB_UNSET) {
2250 s->time->h += tmp;
2265 s->time->have_time = 1;
2266 s->time->i = min;
2281 s->time->have_time = 1;
2282 s->time->s = sec;
2297 s->time->us = (f * pow(10, 6 - (ptr - tptr)));
2312 s->time->us = (f * pow(10, 3 - (ptr - tptr)) * 1000);
2321 s->time->have_zone = 1;
2322 s->time->sse = tmp;
2323 s->time->is_localtime = 1;
2324 s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
2325 s->time->z = 0;
2326 s->time->dst = 0;
2327 timelib_update_from_sse(s->time);
2349 timelib_time_reset_fields(s->time);
2353 timelib_time_reset_unset_fields(s->time);
2387 s->time->have_date = 1;
2400 s->time->have_date = 1;
2412 s->time->have_date = 1;
2418 …s->time->z = timelib_parse_zone(&ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapp…
2424 s->time->have_zone = 1;
2428 s->time->z = timelib_parse_tz_minutes(&ptr, s->time);
2429 if (s->time->z == TIMELIB_UNSET) {
2434 s->time->have_zone = 1;
2459 timelib_time_reset_fields(s->time);
2463 timelib_time_reset_unset_fields(s->time);
2477 …if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET || s…
2478 if (s->time->h == TIMELIB_UNSET ) {
2479 s->time->h = 0;
2481 if (s->time->i == TIMELIB_UNSET ) {
2482 s->time->i = 0;
2484 if (s->time->s == TIMELIB_UNSET ) {
2485 s->time->s = 0;
2487 if (s->time->us == TIMELIB_UNSET ) {
2488 s->time->us = 0;
2493 …if (s->time->y != TIMELIB_UNSET && (iso_week_of_year != TIMELIB_UNSET || iso_year != TIMELIB_UNSET…
2496 …if (iso_year != TIMELIB_UNSET && (s->time->y != TIMELIB_UNSET || s->time->m != TIMELIB_UNSET || s-…
2509 …e_from_isodate(iso_year, iso_week_of_year, iso_day_of_week, &s->time->y, &s->time->m, &s->time->d);
2514 /* do funky checking whether the parsed time was valid time */
2515 if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2516 s->time->s != TIMELIB_UNSET &&
2517 !timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
2518 add_pbf_warning(s, TIMELIB_WARN_INVALID_TIME, "The parsed time was invalid", string, ptr);
2521 if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2522 s->time->d != TIMELIB_UNSET &&
2523 !timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
2532 return in.time;
2597 timelib_time time = timelib_strtotime("May 12");
2600 time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
2601 if (time.have_relative) {
2603time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative…
2605 if (time.have_weekday_relative) {
2606 printf (" / %d", time.relative.weekday);
2608 if (time.have_weeknr_day) {
2609 printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);