]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add function to format local time in ISO format
authorNick Mathewson <nickm@torproject.org>
Mon, 22 Nov 2004 21:38:44 +0000 (21:38 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 22 Nov 2004 21:38:44 +0000 (21:38 +0000)
svn:r2935

src/common/util.c
src/common/util.h

index f725c7c902ead9d88c69453e344a0eabb72bd80c..d3add33e1601c59ec280cd2550822a8e85192bf3 100644 (file)
@@ -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));
 }
index 043d77c45ab9e157da8289f9ca282a691a6c73c1..ea635579adacbbeca86519a5639e655549fddbc8 100644 (file)
@@ -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);