src/lib/ASN1ContentHandler.h
branchv_0
changeset 22 9b6f86760384
parent 21 705036445672
child 23 8941a679299f
--- a/src/lib/ASN1ContentHandler.h	Mon Jun 28 22:48:04 2021 +0200
+++ b/src/lib/ASN1ContentHandler.h	Wed Jun 30 20:11:39 2021 +0200
@@ -201,7 +201,9 @@
 		int8_t hour = 0;
 		int8_t minute = 0;
 		int8_t second = 0;
-		// TODO: ms/ns
+		int32_t nanosecond = 0;
+		int8_t timezoneHour = 0;
+		int8_t timezoneMinute = 0;
 
 		virtual ~DateTime() {
 		}
@@ -215,7 +217,10 @@
 			result << "T" << std::setw(2) << (int) hour;
 			result << ":" << std::setw(2) << (int) minute;
 			result << ":" << std::setw(2) << (int) second;
-			result << "+00:00"; // TODO: timezone
+			if (precision == Precision::Nanosecond) result << "," << (int) nanosecond;
+			result << (timezoneHour < 0 ? "-" : "+");
+			result << std::setw(2) << (int) std::abs(timezoneHour);
+			result << ":" << std::setw(2) << (int) timezoneMinute;
 			return result.str();
 		}
 	};