summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2016-09-01 12:31:33 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2016-09-01 12:31:33 +0100
commitab76a49b22f792001f6bfb49bef4237429500ca2 (patch)
tree07d289ee5017fdb9899dbdb1ab1be84ac33d430d /gtk2_ardour/ardour_ui.cc
parent22d1f1268b909f8fb9672899ae64580938fb3273 (diff)
Fix a bug when formatting time strings
It seems that 'strftime()' (on Windows) works differently from its non-Windows counterparts. Specifically, some formatting options (e.g. %F) are not recognised in the Windows implementation. Fortunately, glibmm comes to our rescue here! So let's use the glib implementation which will hopefully work the same on all platforms.
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index f28913bab3..e9ed833c7d 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -2733,14 +2733,8 @@ ARDOUR_UI::snapshot_session (bool switch_to_it)
if (switch_to_it) {
prompter.set_initial_text (_session->snap_name());
} else {
- char timebuf[128];
- time_t n;
- struct tm local_time;
-
- time (&n);
- localtime_r (&n, &local_time);
- strftime (timebuf, sizeof(timebuf), "%FT%H.%M.%S", &local_time);
- prompter.set_initial_text (timebuf);
+ Glib::DateTime tm (g_date_time_new_now_local ());
+ prompter.set_initial_text (tm.format ("%FT%H.%M.%S"));
}
bool finished = false;