Net.Bluewalk.DotNetUtils/Extensions/DateTimeExtensions.cs
/// <summary>
/// Randoms the specified time span.
/// </summary>
/// <param name="value">The value.</param>
/// <param name="timeSpan">The time span.</param>
/// <returns>DateTime.</returns>
Randoms the specified time span.
Randoms the specified time span .
public static DateTime Random(this DateTime value, TimeSpan timeSpan)
        {
            var seconds = timeSpan.TotalSeconds * StaticRandom.Instance.NextDouble();
            var span = TimeSpan.FromSeconds(seconds);
            return value - span;
        }
public static DateTime Random ( this DateTime value , TimeSpan timeSpan ) { var seconds = timeSpan . TotalSeconds * StaticRandom . Instance . NextDouble ( ) ; var span = TimeSpan . FromSeconds ( seconds ) ; return value - span ; }
Randoms the specified time span.
Randoms the specified time span .
// Alternatively: return value.AddSeconds(-seconds);
None
DateTime
this
timeSpan
TimeSpan
The time span.
The time span .
value
None