--- a/libgweather/gweather-info.c
+++ b/libgweather/gweather-info.c
@@ -14,7 +14,9 @@
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
+#ifndef G_OS_WIN32
 #include <langinfo.h>
+#endif
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
--- a/libgweather/gweather-private.h
+++ b/libgweather/gweather-private.h
@@ -22,6 +22,10 @@
 #define INVALID_IDX G_MAXUINT16
 #define IDX_VALID(idx) ((idx) < 0xffff)
 #define EMPTY_TO_NULL(s) ((s)[0] == '\0' ? NULL : (s))
+
+#ifdef _timezone
+#undef _timezone
+#endif
 
 G_BEGIN_DECLS
 
--- a/libgweather/weather-iwin.c
+++ b/libgweather/weather-iwin.c
@@ -407,7 +407,14 @@
 
     /* see the description here: http://www.weather.gov/forecasts/xml/ */
     now = time (NULL);
+#ifndef G_OS_WIN32
     localtime_r (&now, &tm);
+#else
+    GDate *gdate = g_date_new ();
+    g_date_set_time_t (gdate, now);
+    g_date_to_struct_tm (gdate, &tm);
+    g_date_free (gdate);
+#endif
 
     latstr = _radians_to_degrees_str (loc->latitude);
     lonstr = _radians_to_degrees_str (loc->longitude);
--- a/libgweather/weather-metar.c
+++ b/libgweather/weather-metar.c
@@ -33,7 +33,14 @@
     const time_t now = time (NULL);
     struct tm tm;
 
+#ifndef G_OS_WIN32
     localtime_r (&now, &tm);
+#else
+    GDate *gdate = g_date_new ();
+    g_date_set_time_t (gdate, now);
+    g_date_to_struct_tm (gdate, &tm);
+    g_date_free (gdate);
+#endif
 
     /* If last reading took place just before midnight UTC on the
      * first, adjust the date downward to allow for the month
--- a/libgweather/weather-metno.c
+++ b/libgweather/weather-metno.c
@@ -106,6 +106,7 @@
     GTimeZone *tz;
     GDateTime *dt;
     time_t rval;
+#ifndef G_OS_WIN32
     char *after;
 
     after = strptime ((const char *) str, "%Y-%m-%dT%T", &time);
@@ -116,6 +117,29 @@
 
     if (*after == 'Z')
         tzid = "UTC";
+#else
+    int year;
+    int mon;
+    int mday;
+    int hour;
+    int min;
+    int sec;
+    char *gctz;
+    int parsed = sscanf ((const char*) str, "%d-%d-%dT%d:%d:%d%s",
+                        &year, &mon, &mday, &hour, &min, &sec, gctz);
+    if (parsed != 7) {
+        g_warning ("Cannot parse date string \"%s\"", str);
+        return 0;
+    }
+    time.tm_year = year + 1900;
+    time.tm_mon = mon + 1;
+    time.tm_mday = mday;
+    time.tm_hour = hour;
+    time.tm_min = min;
+    time.tm_sec = sec;
+    if (*gctz == 'Z')
+        tzid = "UTC";
+#endif
 
     tz = g_time_zone_new_identifier (tzid);
     if (tz == NULL)
--- a/libgweather/weather-owm.c
+++ b/libgweather/weather-owm.c
@@ -10,7 +10,9 @@
 
 #include <assert.h>
 #include <ctype.h>
+#ifndef G_OS_WIN32
 #include <langinfo.h>
+#endif
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -119,6 +121,7 @@
     GTimeZone *tz;
     GDateTime *dt;
     time_t rval;
+#ifndef G_OS_WIN32
     char *after;
 
     after = strptime ((const char *) str, "%Y-%m-%dT%T", &time);
@@ -129,6 +132,29 @@
 
     if (*after == 'Z')
         tzid = "UTC";
+#else
+    int year;
+    int mon;
+    int mday;
+    int hour;
+    int min;
+    int sec;
+    char *gctz;
+    int parsed = sscanf ((const char*) str, "%d-%d-%dT%d:%d:%d%s",
+                        &year, &mon, &mday, &hour, &min, &sec, gctz);
+    if (parsed != 7) {
+        g_warning ("Cannot parse date string \"%s\"", str);
+        return 0;
+    }
+    time.tm_year = year + 1900;
+    time.tm_mon = mon + 1;
+    time.tm_mday = mday;
+    time.tm_hour = hour;
+    time.tm_min = min;
+    time.tm_sec = sec;
+    if (*gctz == 'Z')
+        tzid = "UTC";
+#endif
 
     tz = g_time_zone_new_identifier (tzid);
     if (tz == NULL)
--- a/libgweather/weather-sun.c
+++ b/libgweather/weather-sun.c
@@ -292,7 +292,14 @@
     _gweather_info_ensure_sun (info);
 
     /* Determine when the next local midnight occurs */
+#ifndef G_OS_WIN32
     (void) localtime_r (&now, &ltm);
+#else
+    GDate *gdate = g_date_new ();
+    g_date_set_time_t (gdate, now);
+    g_date_to_struct_tm (gdate, &ltm);
+    g_date_free (gdate);
+#endif
     ltm.tm_sec = 0;
     ltm.tm_min = 0;
     ltm.tm_hour = 0;
