mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-10 22:23:34 +02:00
Merge branch 'obsd-master'
Conflicts: tmux.c
This commit is contained in:
15
clock.c
15
clock.c
@ -103,13 +103,20 @@ clock_draw(struct screen_write_ctx *ctx, int colour, int style)
|
||||
struct grid_cell gc;
|
||||
char tim[64], *ptr;
|
||||
time_t t;
|
||||
struct tm *tm;
|
||||
u_int i, j, x, y, idx;
|
||||
|
||||
t = time(NULL);
|
||||
if (style == 0)
|
||||
strftime(tim, sizeof tim, "%l:%M %p", localtime(&t));
|
||||
else
|
||||
strftime(tim, sizeof tim, "%H:%M", localtime(&t));
|
||||
tm = localtime(&t);
|
||||
if (style == 0) {
|
||||
strftime(tim, sizeof tim, "%l:%M ", localtime(&t));
|
||||
if (tm->tm_hour >= 12)
|
||||
strlcat(tim, "PM", sizeof tim);
|
||||
else
|
||||
strlcat(tim, "AM", sizeof tim);
|
||||
} else
|
||||
strftime(tim, sizeof tim, "%H:%M", tm);
|
||||
|
||||
|
||||
screen_write_clearscreen(ctx);
|
||||
|
||||
|
Reference in New Issue
Block a user