diff options
-rw-r--r-- | src/common/util.c | 4 | ||||
-rw-r--r-- | src/common/util.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index f725c7c902..d3add33e16 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -617,6 +617,10 @@ int parse_rfc1123_time(const char *buf, time_t *t) { return 0; } +void format_local_iso_time(char *buf, time_t t) { + strftime(buf, ISO_TIME_LEN+1, "%Y-%m-%d %H:%M:%S", localtime(&t)); +} + void format_iso_time(char *buf, time_t t) { strftime(buf, ISO_TIME_LEN+1, "%Y-%m-%d %H:%M:%S", gmtime(&t)); } diff --git a/src/common/util.h b/src/common/util.h index 043d77c45a..ea635579ad 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -79,6 +79,7 @@ time_t tor_timegm(struct tm *tm); void format_rfc1123_time(char *buf, time_t t); int parse_rfc1123_time(const char *buf, time_t *t); #define ISO_TIME_LEN 19 +void format_local_iso_time(char *buf, time_t t); void format_iso_time(char *buf, time_t t); int parse_iso_time(const char *buf, time_t *t); |