CSharp examples for System:Random
Generates Random DateTime.
// Copyright (c) 2014 IBT All rights reserved. using System.Text; using System;/*from w w w . j ava2s . c o m*/ public class Main{ public static Random random = new Random(); /// <summary> /// Generates an id. /// </summary> /// <returns></returns> public static DateTime RandomDate(int daysback) { return DateTime.UtcNow.AddDays(-(random.Next(0, daysback))); } }