[ntp:questions] ntp version 4.2.7p257-o

Uwe Klein uwe at klein-habertwedt.de
Wed Feb 22 09:14:04 UTC 2012


Terje Mathisen wrote:
> Uwe Klein wrote:
> 
>> Terje Mathisen wrote:
>>
>>> I.e. that seems to work, but I haven't found a way for the built-in
>>> strftime() to output number of days, so I had to handle that separately.
>>
>>
>> %j
> 
> 
> Except %j starts with 1 instead of 0.
> 
> (I did of course try that option!)
> 
> :-(
> 
> Terje
> 
this was my tcl way to do "runtime" printing:

     method val2string val {
         switch -- [ expr $val / 86400 ] \
            0    {
             return [ clock format  $val -format "%T" -gmt 1 ]
         }  1    {
             return [ string trimleft [ clock format  [ expr $val - 86400 ] \
                     -format "%j [ mc Day ] %X" -gmt 1 ] 0 ]
         } default {
             return [ string trimleft [ clock format  [ expr $val - 86400 ] \
                     -format "%j [ mc Days ] %X" -gmt 1 ] 0 ]
         }
     }

uwe



More information about the questions mailing list