(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:
@@ -64,3 +64,16 @@ krb5_us_timeofday (krb5_context context,
|
|||||||
*usec = tv.tv_usec; /* XXX */
|
*usec = tv.tv_usec; /* XXX */
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user