From 811fc89f0eb036d95653f5fed4b0ffea292ce791 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 4 Aug 2015 15:58:39 +0100 Subject: Document everything, and turn on errors if we fail to document anything in the future. --- .../Google.Protobuf/WellKnownTypes/TimeExtensions.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs') diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs b/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs index a3806b5c..dd485d32 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs @@ -43,16 +43,35 @@ namespace Google.Protobuf.WellKnownTypes /// public static class TimeExtensions { + /// + /// Converts the given to a . + /// + /// The date and time to convert to a timestamp. + /// The value has a other than Utc. + /// The converted timestamp. public static Timestamp ToTimestamp(this DateTime dateTime) { return Timestamp.FromDateTime(dateTime); } + /// + /// Converts the given to a + /// + /// The offset is taken into consideration when converting the value (so the same instant in time + /// is represented) but is not a separate part of the resulting value. In other words, there is no + /// roundtrip operation to retrieve the original DateTimeOffset. + /// The date and time (with UTC offset) to convert to a timestamp. + /// The converted timestamp. public static Timestamp ToTimestamp(this DateTimeOffset dateTimeOffset) { return Timestamp.FromDateTimeOffset(dateTimeOffset); } + /// + /// Converts the given to a . + /// + /// The time span to convert. + /// The converted duration. public static Duration ToDuration(this TimeSpan timeSpan) { return Duration.FromTimeSpan(timeSpan); -- cgit v1.2.3