How to subtract a month from Date object?

前端 未结 4 1871
名媛妹妹
名媛妹妹 2021-02-06 23:48

How do I subtract a month from a date object in VB.NET?

I have tried:

Today.AddMonths(-1)

However, given that Today is 01-Jan-2010, the

4条回答
  •  逝去的感伤
    2021-02-07 00:39

    I have used the following and it works.

    Dim dtToday As DateTime = Date.Today
    dtToday = dtToday.AddMonths(-2)
    

提交回复
热议问题