(krb5_format_time): new function to format time

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8488 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2000-06-29 08:20:52 +00:00
parent d044762573
commit e8e1dc71bf

View File

@@ -64,3 +64,16 @@ krb5_us_timeofday (krb5_context context,
*usec = tv.tv_usec; /* XXX */
return 0;
}
krb5_error_code
krb5_format_time(krb5_context context, time_t t,
char *s, size_t len, krb5_boolean include_time)
{
struct tm *tm;
if(context->log_utc)
tm = gmtime (&t);
else
tm = localtime(&t);
strftime(s, len, include_time ? context->time_fmt : context->date_fmt, tm);
return 0;
}