CSharp examples for System:TimeSpan
Get Random Time Span
using System.Globalization; using System.Text.RegularExpressions; using System.Web; using System.Linq; using System.Collections.Generic; using System;/*from w ww . j av a2s.c o m*/ public class Main{ public static string GetRandomTimeSpan() { TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0); return Convert.ToInt64(ts.TotalSeconds).ToString(); } }