mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-26 15:08:17 +01:00
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.
This commit is contained in:
parent
22d1f1268b
commit
ab76a49b22
1 changed files with 2 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue