Lines Matching refs:tm_time
45 struct tm tm_time;
95 memcpy(&tm_time, localtime(&tm), sizeof(tm_time));
98 tm_time.tm_sec = 0;
99 tm_time.tm_min = 0;
100 tm_time.tm_hour = 0;
104 strptime(date_str, hintfmt_arg, &tm_time);
106 /* Parse input and assign appropriately to tm_time */
108 if (sscanf(date_str, "%d:%d:%d", &tm_time.tm_hour, &tm_time.tm_min,
109 &tm_time.tm_sec) == 3) {
111 } else if (sscanf(date_str, "%d:%d", &tm_time.tm_hour,
112 &tm_time.tm_min) == 2) {
114 } else if (sscanf(date_str, "%d.%d-%d:%d:%d", &tm_time.tm_mon,
115 &tm_time.tm_mday, &tm_time.tm_hour,
116 &tm_time.tm_min, &tm_time.tm_sec) == 5) {
118 tm_time.tm_mon -= 1;
119 } else if (sscanf(date_str, "%d.%d-%d:%d", &tm_time.tm_mon,
120 &tm_time.tm_mday,
121 &tm_time.tm_hour, &tm_time.tm_min) == 4) {
123 tm_time.tm_mon -= 1;
124 } else if (sscanf(date_str, "%d.%d.%d-%d:%d:%d", &tm_time.tm_year,
125 &tm_time.tm_mon, &tm_time.tm_mday,
126 &tm_time.tm_hour, &tm_time.tm_min,
127 &tm_time.tm_sec) == 6) {
128 tm_time.tm_year -= 1900; /* Adjust years */
129 tm_time.tm_mon -= 1; /* Adjust dates from 1-12 to 0-11 */
130 } else if (sscanf(date_str, "%d.%d.%d-%d:%d", &tm_time.tm_year,
131 &tm_time.tm_mon, &tm_time.tm_mday,
132 &tm_time.tm_hour, &tm_time.tm_min) == 5) {
133 tm_time.tm_year -= 1900; /* Adjust years */
134 tm_time.tm_mon -= 1; /* Adjust dates from 1-12 to 0-11 */
142 nr = sscanf(date_str, "%2d%2d%2d%2d%d", &tm_time.tm_mon,
143 &tm_time.tm_mday, &tm_time.tm_hour, &tm_time.tm_min,
144 &tm_time.tm_year);
152 nr = sscanf(cp + 1, "%2d", &tm_time.tm_sec);
159 if (tm_time.tm_year >= 1900) {
160 tm_time.tm_year -= 1900;
163 tm_time.tm_mon -= 1;
167 tm_time.tm_isdst = -1; /* Be sure to recheck dst. */
168 tm = mktime(&tm_time);
231 strftime(date_buf, sizeof(date_buf), date_fmt, &tm_time);