Print create date in planner output - help needed

Stefan Fuchs sfuchs at gmx.de
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,
%s<br></div>"),
            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

-- 

Stefan Fuchs
E-Mail: sfuchs at gmx.de <mailto:sfuchs at gmx.de>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20170330/ead026cf/attachment.html>


More information about the subsurface mailing list