title: How can I get a random time between Now and some previous time point (eg. 1 hour ago)?
body: <p>I'm trying to make an extension method that allows me to create a random time between Now and some user requested historical time point in the form of a TimeSpan.</p>
  
  <p>For example : <strong>a random time between now and 1 hour ago.</strong></p>
  
  <p>So, I came up with the following <code>Random(..)</code> extension method.</p>
  
  <p>I thought to make the random seed NOT static, but if i call this method a LOT and QUICKLY (eg. in a loop), then I thought the seed (which is based on time) isn't really random for really fast calls. is that true? (it seems to be, when i check my results)</p>
  
  <pre><code>public static DateTimeOffset Random(this DateTimeOffset value, TimeSpan timeSpan)
  {
      var random = new Random();
      DateTimeOffset minDateTime = value.Subtract(timeSpan);
      int range = ((DateTime.Today - minDateTime)).Hours;
      return minDateTime.AddHours(random.Next(range));
  }
  </code></pre>