epicsTimeToStrftime problem with %06f format

Bug #541311 reported by Dirk Zimoch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Medium
Jeff Hill

Bug Description

The %0#f format (# any number) works only if it is the last part of the format string.
What does not work: "%S.%03f sec", "%S.%03fn", "%S.%03 %Y" ...

Original Mantis Bug: mantis-279
    http://www.aps.anl.gov/epics/mantis/view_bug_page.php?f_id=279

Tags: libcom 3.14
Revision history for this message
Dirk Zimoch (dirk.zimoch) wrote :

The second example string should have "backslash n" as the last 2 characters. Mantis has skipped the backslash.

Revision history for this message
Jeff Hill (johill-lanl) wrote :

Its somewhat complicated to fix this because, as written by William Lupton as I recall, this function sends most of the format string to ordinary strftime, and appends what %f specifies onto what strftime generates.

Maybe we could break up the incoming string into three parts.

1) The part before %f
2) the %f
3) the part after %f

Using that approach we could call strftime to do the first part of the string, add the %f output, and then call strftime to complete the last part of the string.

And of course to do it 100% right we would need to assume that there could be more than one %f embedded in the format, but that only requires a loop around what I have outlined above.

That doesnt sound overwhelmingly difficult to implement.

edited on: 2006-12-18 09:59

Revision history for this message
Andrew Johnson (anj) wrote :

Note that the Application Developers' Guide currently documents exactly what the epicsTime::strftime() method actually does, explicitly stating that %0<n>f is only looked for at the end of the string. I admit that this isn't as useful as being able to put it anywhere would be, but strictly speaking this report is a feature request, not a bug fix. As such we will not delay the release of R3.14.9 while waiting for its solution, although if a patch is donated in time I'll be happy to see it included.

Revision history for this message
Jeff Hill (johill-lanl) wrote :

fixed in R3.14.9

Revision history for this message
Andrew Johnson (anj) wrote :

R3.14.9 Released.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.