CSharp examples for System:DateTime Second
Will give you the DateTime object given the number of seconds you go back.
using System;/* w w w. j a v a 2 s. co m*/ public class Main{ /// <summary> /// Will give you the DateTime object given the number of seconds you go back. /// </summary> /// <param name="seconds"> /// The days. /// </param> /// <returns> /// DateTime object /// </returns> public static DateTime SecondsAgo(this int seconds) { var t = new TimeSpan(0, 0, seconds); return DateTime.Now.Subtract(t); } }