On Tue, Jan 20, 2009 at 9:47 AM, Aaron Davies <aaron.dav...@gmail.com> wrote:

> there doesn't seem to be a specific escape for hour or minute, and %c prints 
> unpadded and colon-separated.
>
> for purposes of setting 7logfile, i'd like to be able to get the same time 
> format that
>
> date +%H%M%S
>
> yields (ie zero-padded and unpunctuated)

ok, here's a patch (i can't get github to work so this is against the
tarball http://www.wpursell.net/screen-4.1.0w.110-349d.tar.gz)

i picked %i, %I, and %j as the first two adjacent free letters; feel
free to use something else if you like
--
Aaron Davies
aaron.dav...@gmail.com
diff -r screen-4.1.0w.110-349d/src/doc/screen.texinfo 
screen-hacked/src/doc/screen.texinfo
4754a4755,4760
> @item i
> current hour @code{HH} in 12h format
> @item I
> current hour @code{HH} in 24h format
> @item j
> current minute @code{MM}
4811c4817
< The @code{c} and @code{C} escape may be qualified with a @code{0} to
---
> The @code{c}, @code{C}, @code{i}, and @code{I} escapes may be qualified with 
> a @code{0} to
diff -r screen-4.1.0w.110-349d/src/screen.c screen-hacked/src/screen.c
2533c2533,2534
<       case 'a': case 'A': case 's': case 'c': case 'C':
---
>       case 'a': case 'A': case 's': case 'c': case 'C': case 'j':
>       case 'i': case 'I':
2591a2593,2607
>           case 'i':
>             sprintf(p, zeroflg ? "%02d" : "%2d", tm->tm_hour);
>             if (!tick || tick > 60)
>               tick = 60;
>             break;
>           case 'I':
>             sprintf(p, zeroflg ? "%02d" : "%2d", (tm->tm_hour + 11) % 12 + 1);
>             if (!tick || tick > 60)
>               tick = 60;
>             break;
>           case 'j':
>             sprintf(p, "%02d", tm->tm_min);
>             if (!tick || tick > 60)
>               tick = 60;
>             break;
_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to