Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Datetime

Datetime

Scheduled Pinned Locked Moved ASP.NET
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 4 Offline
    4 Offline
    4anusha4
    wrote on last edited by
    #1

    How can I reduce exactly 6 months from a specific date?

    D M C 3 Replies Last reply
    0
    • 4 4anusha4

      How can I reduce exactly 6 months from a specific date?

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      Assuming that you don't need to bother about Time zones, Day light savings etc., you can use the AddMonths method of the DateTime instance. You just need to pass negative value to subtract and positive value to add. MSDN listing for AddMonths method[^] HTH!

      4 1 Reply Last reply
      0
      • D Dinesh Mani

        Assuming that you don't need to bother about Time zones, Day light savings etc., you can use the AddMonths method of the DateTime instance. You just need to pass negative value to subtract and positive value to add. MSDN listing for AddMonths method[^] HTH!

        4 Offline
        4 Offline
        4anusha4
        wrote on last edited by
        #3

        ya i got it thank u

        1 Reply Last reply
        0
        • 4 4anusha4

          How can I reduce exactly 6 months from a specific date?

          M Offline
          M Offline
          Manish_Kumar_Nayak
          wrote on last edited by
          #4

          I dont know is this posible in asp.net but you try this with Sql 'Select DateAdd(month,-6,'03/06/2010')' Output :'2009-09-06 00:00:00.000' :-O

          1 Reply Last reply
          0
          • 4 4anusha4

            How can I reduce exactly 6 months from a specific date?

            C Offline
            C Offline
            carlecomm
            wrote on last edited by
            #5

            DateTime specificdate= DateTime.Now; specificdate.AddMonths(-6);

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups