1
0
Files
irix-657m-src/irix/cmd/netman/lib/protocols/ip_timestamp.c
2022-09-29 17:59:04 +03:00

21 lines
458 B
C

/*
* Copyright 1988 Silicon Graphics, Inc. All rights reserved.
*
* Return a string representation of an IP timestamp (in host order).
*/
#include <stdio.h>
#include "protocols/ip.h"
char *
ip_timestamp(n_long time)
{
static char buf[sizeof "hh:mm:ss.mmm"];
(void) sprintf(buf, "%02lu:%02lu:%02lu.%03lu",
(time / (60 * 60 * 1000)) % 24,
(time / (60 * 1000)) % 60,
(time / 1000) % 60,
time % 1000);
return buf;
}