Changeset 2747
- Timestamp:
- 11/06/07 16:15:40 (10 months ago)
- Files:
-
- trunk/opensync/format/opensync_time.c (modified) (1 diff)
- trunk/tests/format-tests/check_time.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/opensync/format/opensync_time.c
r2368 r2747 288 288 GString *vtime = g_string_new(""); 289 289 struct tm my_time = *time; 290 const char *tz = NULL; 290 291 291 292 /* ask C library to clean up any anomalies */ 293 if (is_utc) { 294 tz = g_getenv("TZ"); 295 putenv("TZ=Etc/UTC"); 296 } 292 297 mktime(&my_time); 298 if(is_utc) { 299 if (tz) { 300 g_setenv("TZ", tz, TRUE); 301 } else { 302 g_unsetenv("TZ"); 303 } 304 } 293 305 294 306 g_string_printf(vtime, "%04d%02d%02dT%02d%02d%02d", trunk/tests/format-tests/check_time.c
r2529 r2747 163 163 struct tm base; 164 164 165 166 putenv("TZ=America/Montreal"); 167 165 168 // simple test, no DST 166 169 base.tm_sec = 0;
