DateTime类型通过以下函数更改时间。这种改变方式不改变变量本身。
This method does not change the value of this DateTime. Instead, a new DateTime is returned whose value is the result of this operation
Name | Description | |
---|---|---|
Add | Adds the value of the specified TimeSpan to the value of this instance. | |
AddDays | Adds the specified number of days to the value of this instance. | |
AddHours | Adds the specified number of hours to the value of this instance. | |
AddMilliseconds | Adds the specified number of milliseconds to the value of this instance. | |
AddMinutes | Adds the specified number of minutes to the value of this instance. | |
AddMonths | Adds the specified number of months to the value of this instance. | |
AddSeconds | Adds the specified number of seconds to the value of this instance. | |
AddTicks | Adds the specified number of ticks to the value of this instance. | |
AddYears | Adds the specified number of years to the value of this instance. |