(#15) Document possible ArgumentOutOfRangeException

This commit is contained in:
Oliver Booth 2021-07-20 17:01:30 +01:00
parent 78830a3b9e
commit 9a26031245
No known key found for this signature in database
GPG Key ID: A4AC17007530E9B4
3 changed files with 30 additions and 0 deletions

View File

@ -17,6 +17,11 @@ namespace X10D
/// 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative.
/// </param>
/// <returns>A date and time value that represents the same moment in time as the Unix time.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <para><paramref name="value" /> is less than -62,135,596,800,000.</para>
/// -or-
/// <para><paramref name="value" /> is greater than 253,402,300,799,999.</para>
/// </exception>
public static DateTimeOffset FromUnixTimeMilliseconds(this short value)
{
return DateTimeOffset.FromUnixTimeMilliseconds(value);
@ -31,6 +36,11 @@ namespace X10D
/// 12:00 AM UTC). For Unix times before this date, its value is negative.
/// </param>
/// <returns>A date and time value that represents the same moment in time as the Unix time.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <para><paramref name="value" /> is less than -62,135,596,800.</para>
/// -or-
/// <para><paramref name="value" /> is greater than 253,402,300,799.</para>
/// </exception>
public static DateTimeOffset FromUnixTimeSeconds(this short value)
{
return DateTimeOffset.FromUnixTimeSeconds(value);

View File

@ -17,6 +17,11 @@ namespace X10D
/// 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative.
/// </param>
/// <returns>A date and time value that represents the same moment in time as the Unix time.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <para><paramref name="value" /> is less than -62,135,596,800,000.</para>
/// -or-
/// <para><paramref name="value" /> is greater than 253,402,300,799,999.</para>
/// </exception>
public static DateTimeOffset FromUnixTimeMilliseconds(this int value)
{
return DateTimeOffset.FromUnixTimeMilliseconds(value);
@ -31,6 +36,11 @@ namespace X10D
/// 12:00 AM UTC). For Unix times before this date, its value is negative.
/// </param>
/// <returns>A date and time value that represents the same moment in time as the Unix time.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <para><paramref name="value" /> is less than -62,135,596,800.</para>
/// -or-
/// <para><paramref name="value" /> is greater than 253,402,300,799.</para>
/// </exception>
public static DateTimeOffset FromUnixTimeSeconds(this int value)
{
return DateTimeOffset.FromUnixTimeSeconds(value);

View File

@ -17,6 +17,11 @@ namespace X10D
/// 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative.
/// </param>
/// <returns>A date and time value that represents the same moment in time as the Unix time.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <para><paramref name="value" /> is less than -62,135,596,800,000.</para>
/// -or-
/// <para><paramref name="value" /> is greater than 253,402,300,799,999.</para>
/// </exception>
public static DateTimeOffset FromUnixTimeMilliseconds(this long value)
{
return DateTimeOffset.FromUnixTimeMilliseconds(value);
@ -31,6 +36,11 @@ namespace X10D
/// 12:00 AM UTC). For Unix times before this date, its value is negative.
/// </param>
/// <returns>A date and time value that represents the same moment in time as the Unix time.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <para><paramref name="value" /> is less than -62,135,596,800.</para>
/// -or-
/// <para><paramref name="value" /> is greater than 253,402,300,799.</para>
/// </exception>
public static DateTimeOffset FromUnixTimeSeconds(this long value)
{
return DateTimeOffset.FromUnixTimeSeconds(value);