From 7f0d159195c28709c5f7f3a2e7658b4babcb9972 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 1 May 2013 01:30:55 +0100 Subject: [PATCH] Simpler and better use of time display for tracks. Make consistent use of time format as used in trackpoint and waypoint displays. --- src/viktrwlayer_propwin.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/viktrwlayer_propwin.c b/src/viktrwlayer_propwin.c index 0294e4cf..78ce8066 100644 --- a/src/viktrwlayer_propwin.c +++ b/src/viktrwlayer_propwin.c @@ -3018,14 +3018,10 @@ void vik_trw_layer_propwin_run ( GtkWindow *parent, t1 = VIK_TRACKPOINT(tr->trackpoints->data)->timestamp; t2 = VIK_TRACKPOINT(g_list_last(tr->trackpoints)->data)->timestamp; - strncpy(tmp_buf, ctime(&t1), sizeof(tmp_buf)); - tmp_buf[sizeof(tmp_buf)-1] = 0; - g_strchomp(tmp_buf); + strftime (tmp_buf, sizeof(tmp_buf), "%c", localtime(&(t1))); widgets->w_time_start = content[cnt++] = gtk_label_new(tmp_buf); - strncpy(tmp_buf, ctime(&t2), sizeof(tmp_buf)); - tmp_buf[sizeof(tmp_buf)-1] = 0; - g_strchomp(tmp_buf); + strftime (tmp_buf, sizeof(tmp_buf), "%c", localtime(&(t2))); widgets->w_time_end = content[cnt++] = gtk_label_new(tmp_buf); g_snprintf(tmp_buf, sizeof(tmp_buf), _("%d minutes"), (int)(t2-t1)/60); -- 2.39.5