HoursAgo

Contents

Namespace

SubSonic.Extensions.Dates

Summary

Returns a date in the future by hours

Example

DateTime then=3.HoursAgo();

Unit Test

        public void HoursAgo_Shoud_Return_DateTime_AddHours_Neg3_For_3() {
            var today = DateTime.Now;
            var then = 3.HoursAgo();
 
            Assert.Equal(then, DateTime.Now.AddHours(-3));
        }

Comments

SubSonic 3.0 implements this as an extension on System.Int- 2.x uses a static method on SubSonic.Sugar.Dates.