Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/utils.c @ 463:339e85418b49
from_iso8601(): set time to 00:00:00 if not specified
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 29 Sep 2005 22:03:22 +0200 |
parents | 471c9ccde028 |
children | 05c0e55c4bb1 |
comparison
equal
deleted
inserted
replaced
462:d580e87c11ed | 463:339e85418b49 |
---|---|
176 int tzoff = 0; | 176 int tzoff = 0; |
177 | 177 |
178 time(&retval); | 178 time(&retval); |
179 localtime_r(&retval, &t); | 179 localtime_r(&retval, &t); |
180 | 180 |
181 /* Reset time to midnight (00:00:00) */ | |
182 t.tm_hour = t.tm_min = t.tm_sec = 0; | |
183 | |
181 snprintf(buf, sizeof(buf), "%s", timestamp); | 184 snprintf(buf, sizeof(buf), "%s", timestamp); |
182 c = buf; | 185 c = buf; |
183 | 186 |
184 /* 4 digit year */ | 187 /* 4 digit year */ |
185 if (!sscanf(c, "%04d", &t.tm_year)) return 0; | 188 if (!sscanf(c, "%04d", &t.tm_year)) return 0; |