]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add format_local_iso_time_nospace()
authorNeel Chauhan <neel@neelc.org>
Tue, 17 Apr 2018 00:14:49 +0000 (20:14 -0400)
committerNeel Chauhan <neel@neelc.org>
Tue, 17 Apr 2018 00:37:50 +0000 (20:37 -0400)
src/common/util.c
src/common/util.h

index 041e7aee3d65b68b2cfb7e20ac39e0ab12989c3d..b7516b8b64edead95e8541fabce8698f06e71c35 100644 (file)
@@ -1821,6 +1821,15 @@ format_iso_time(char *buf, time_t t)
   strftime(buf, ISO_TIME_LEN+1, "%Y-%m-%d %H:%M:%S", tor_gmtime_r(&t, &tm));
 }
 
+/** As format_local_iso_time, but use the yyyy-mm-ddThh:mm:ss format to avoid
+ * embedding an internal space. */
+void
+format_local_iso_time_nospace(char *buf, time_t t)
+{
+  format_local_iso_time(buf, t);
+  buf[10] = 'T';
+}
+
 /** As format_iso_time, but use the yyyy-mm-ddThh:mm:ss format to avoid
  * embedding an internal space. */
 void
index ae27e5f016c829eac65b458fbee0c48d8d50b575..5708b7fd867a7d02ae68d87aa86995ad1cad1b75 100644 (file)
@@ -269,6 +269,7 @@ int parse_rfc1123_time(const char *buf, time_t *t);
 #define ISO_TIME_USEC_LEN (ISO_TIME_LEN+7)
 void format_local_iso_time(char *buf, time_t t);
 void format_iso_time(char *buf, time_t t);
+void format_local_iso_time_nospace(char *buf, time_t t);
 void format_iso_time_nospace(char *buf, time_t t);
 void format_iso_time_nospace_usec(char *buf, const struct timeval *tv);
 int parse_iso_time_(const char *cp, time_t *t, int strict, int nospace);