The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Browse by Tags

All Tags » datetime (RSS)
Sorry, but there are no more tags available to filter with.
  • Subtracting months in .NET (approximately)

    Spotted this in an ASP.NET application I'm maintaining.... DateTime SinceDate = DateTime.Now.Subtract(new TimeSpan((30 * 13), 0, 0, 0)); // approx 13 calender months ago ...and there's me thinking what's wrong with using this... DateTime SinceDate = DateTime.Now.AddMonths(-13); // EXACTLY...
    Posted to Forum by Sunday Ironfoot on 07-03-2008
Page 1 of 1 (1 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems