- Allocate buffer large enough to contain UNIX_PATH_MAX size pathnames in case of...
[oweals/gnunet.git] / src / util / strings.c
index 92e24c1b7ffa6d9665b778b82244d04074122bae..c7eda9ad9c719bce63e0a26f41b4faae499604d4 100644 (file)
@@ -347,9 +347,6 @@ GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time,
 {
   struct tm tv;
   time_t t;
-#if HAVE_TM_GMTOFF
-  struct tm *tp;
-#endif
 
   if (0 == strcasecmp ("end of time", fancy_time))
   {
@@ -370,22 +367,6 @@ GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time,
     return GNUNET_SYSERR;
   t = mktime (&tv);
   atime->abs_value_us = (uint64_t) ((uint64_t) t * 1000LL * 1000LL);
-#if HAVE_TM_GMTOFF
-  tp = localtime (&t);
-  atime->abs_value_us += 1000LL * 1000LL * tp->tm_gmtoff;
-#elif defined LINUX
-  atime->abs_value_us -= 1000LL * 1000LL * timezone;
-#elif defined WINDOWS
-  {
-    DWORD tzv;
-    TIME_ZONE_INFORMATION tzi;
-    tzv = GetTimeZoneInformation (&tzi);
-    if (TIME_ZONE_ID_INVALID != tzv)
-    {
-      atime->abs_value_us -= 1000LL * 1000LL * tzi.Bias * 60LL;
-    }
-  }
-#endif
   return GNUNET_OK;
 }
 
@@ -744,7 +725,7 @@ GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t)
   if (t.abs_value_us == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us)
     return _("end of time");
   tt = t.abs_value_us / 1000LL / 1000LL;
-  tp = gmtime (&tt);
+  tp = localtime (&tt);
   /* This is hacky, but i don't know a way to detect libc character encoding.
    * Just expect utf8 from glibc these days.
    * As for msvcrt, use the wide variant, which always returns utf16