From: Andy Spencer Date: Sat, 18 Feb 2012 03:09:43 +0000 (+0000) Subject: Revert "Fix off-by-one on date" X-Git-Url: http://pileus.org/git/?p=aweather;a=commitdiff_plain;h=b669a540beef89cb39fa1f7ec195002eca47440b Revert "Fix off-by-one on date" 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. --- diff --git a/src/plugins/level2.c b/src/plugins/level2.c index 7b19d83..d5566e1 100644 --- a/src/plugins/level2.c +++ b/src/plugins/level2.c @@ -419,7 +419,7 @@ GtkWidget *aweather_level2_get_config(AWeatherLevel2 *level2) /* Add date */ gchar *date_str = g_strdup_printf("%04d-%02d-%02d %02d:%02d", - 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);