diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-08 23:32:12 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-08 23:32:12 +0100 |
commit | 7696380cfd9e1a349651f2de8055e71244d6f8b3 (patch) | |
tree | 4125aaffa66ee464f95346c195f88ea08fe97ee5 /gtk2_ardour/ardour_ui_session.cc | |
parent | 9e2b896516c6ae26ebf1b55a674c1366154d64e2 (diff) |
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.
Diffstat (limited to 'gtk2_ardour/ardour_ui_session.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui_session.cc | 17 |
1 files 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); } |