Home Cooker Classes Others Rice CookerGX
Classes  >  datetime  >  AddDays(int)
datetime class : AddDays(int) method

Description

Gets the new datetime instance which is obtained by adding the number of days to the invoker instance.

Syntax

datetimeInstance.AddDays(int numberOfDays)

Arguments

ClassNameDescription
intnumberOfDaysNumber of days

Return value

ClassDescription
datetimeNew datetime type instance which is obtained by adding the argument.

Sample code

datetime dt = new datetime(2016, 3, 4, 4, 13, 0);

datetime addDay1 = dt.AddDays(5);//2016/3/9 4:13:00

datetime addDay2 = dt.AddDays(-5);//2016/2/28 4:13:00

Notes

It's a wrapper of the System.DateTime.AddDays(Double).

Links for reference

Copyright © Rice All rights reserved.