summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/time.c')
-rw-r--r--crypto/heimdal/lib/krb5/time.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/crypto/heimdal/lib/krb5/time.c b/crypto/heimdal/lib/krb5/time.c
index e5a1185..98121b4 100644
--- a/crypto/heimdal/lib/krb5/time.c
+++ b/crypto/heimdal/lib/krb5/time.c
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: time.c,v 1.3 2000/02/06 05:21:53 assar Exp $");
+RCSID("$Id: time.c,v 1.4 2000/06/29 08:20:52 joda Exp $");
/*
* return ``corrected'' time in `timeret'.
@@ -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;
+}
OpenPOWER on IntegriCloud