Print create date in planner output - help needed

Stefan Fuchs sfuchs at
Wed Mar 29 23:06:07 PDT 2017

Hi All,

I would like to add this to planner.c to print the date and Subsurface
version to the diveplan:

    char date_planned[100];
    time_t now = time(NULL);
    struct tm *t = localtime(&now);

    strftime(date_planned, sizeof(date_planned)-1, "%d.%m.%Y", t);

    len += snprintf(buffer + len, sz_buffer - len,
translate("gettextFromC", "Plan creation date and version: %s,
            date_planned, subsurface_canonical_version());

There is one issue:
I would like to use the date format as defined in
"prefs.date_format_short". But the Qt syntax of this is not compatible
with the syntax strftime needs. Does anyone know an easy way to convert
the string or in general to solve this?

Best regards


Stefan Fuchs
E-Mail: sfuchs at <mailto:sfuchs at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the subsurface mailing list