diff options
Diffstat (limited to 'libs/gtkmm2ext/gtk_ui.cc')
-rw-r--r-- | libs/gtkmm2ext/gtk_ui.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index e6212a35bd..e38ba71d45 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -649,14 +649,9 @@ void UI::display_message (const char *prefix, gint /*prefix_len*/, RefPtr<TextBuffer::Tag> ptag, RefPtr<TextBuffer::Tag> mtag, const char *msg) { RefPtr<TextBuffer> buffer (errors->text().get_buffer()); + Glib::DateTime tm (g_date_time_new_now_local ()); - char timebuf[128]; - time_t n = time (NULL); - struct tm local_time; - localtime_r (&n, &local_time); - strftime (timebuf, sizeof(timebuf), "%FT%H:%M:%S ", &local_time); - - buffer->insert_with_tag(buffer->end(), timebuf, ptag); + buffer->insert_with_tag(buffer->end(), tm.format ("%FT%H:%M:%S "), ptag); buffer->insert_with_tag(buffer->end(), prefix, ptag); buffer->insert_with_tag(buffer->end(), msg, mtag); buffer->insert_with_tag(buffer->end(), "\n", mtag); |