From 7696380cfd9e1a349651f2de8055e71244d6f8b3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 8 Mar 2020 23:32:12 +0100 Subject: [PATCH] Replace strftime() with Glib::DateTime() -- GUI This is mainly for windows compatibility "%F" is not supported. An alternative would be to s/%F/%Y-%m-%d/ to produce the ISO date. --- gtk2_ardour/ardour_ui_session.cc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/gtk2_ardour/ardour_ui_session.cc b/gtk2_ardour/ardour_ui_session.cc index 9c728a4a87..40bcc0ad79 100644 --- a/gtk2_ardour/ardour_ui_session.cc +++ b/gtk2_ardour/ardour_ui_session.cc @@ -963,18 +963,11 @@ ARDOUR_UI::archive_session () void ARDOUR_UI::quick_snapshot_session (bool switch_to_it) { - 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); - if (switch_to_it && _session->dirty ()) { - save_state_canfail (""); - } - - save_state (timebuf, switch_to_it); + if (switch_to_it && _session->dirty ()) { + save_state_canfail (""); + } + Glib::DateTime tm (g_date_time_new_now_local ()); + save_state (tm.format ("%FT%H.%M.%S"), switch_to_it); }