]> Pileus Git - aweather/commitdiff
Revert "Fix off-by-one on date"
authorAndy Spencer <andy753421@gmail.com>
Sat, 18 Feb 2012 03:09:43 +0000 (03:09 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 19 Feb 2012 21:02:53 +0000 (21:02 +0000)
This issue is related to whether or not the users timezone accounts for
leap seconds in Unix timestamps.

For instance, 1325376000 in TZ=UTC is 2011-01-01 00:00:00, but in
TZ=right/UTC it is 2011-12-31 23:59:36.

RSL generates the dates by using gmtime at time 00:00:00 on a particular
date since the epoch. If the timezone includes leap seconds, this will
return the previous day rather than the desired day, which is why the
original +1 was added to AWeather.

However, nobody uses timezones that include leap seconds (i.e. the
right/ folder) so it's better to leave it how it is.

src/plugins/level2.c

index 7b19d83152a606ff38fe8b1555e1d84e99c75d15..d5566e1749ad8bd7717d13ce604c8126e2908232 100644 (file)
@@ -419,7 +419,7 @@ GtkWidget *aweather_level2_get_config(AWeatherLevel2 *level2)
 
        /* Add date */
        gchar *date_str = g_strdup_printf("<b><i>%04d-%02d-%02d %02d:%02d</i></b>",
 
        /* Add date */
        gchar *date_str = g_strdup_printf("<b><i>%04d-%02d-%02d %02d:%02d</i></b>",
-                       radar->h.year, radar->h.month, radar->h.day+1,
+                       radar->h.year, radar->h.month, radar->h.day,
                        radar->h.hour, radar->h.minute);
        GtkWidget *date_label = gtk_label_new(date_str);
        gtk_label_set_use_markup(GTK_LABEL(date_label), TRUE);
                        radar->h.hour, radar->h.minute);
        GtkWidget *date_label = gtk_label_new(date_str);
        gtk_label_set_use_markup(GTK_LABEL(date_label), TRUE);