C# DateTimeOffset AddMinutes
Description
DateTimeOffset AddMinutes
adds a specified number of
whole and fractional minutes to the current DateTimeOffset object.
Syntax
DateTimeOffset.AddMinutes
has the following syntax.
public DateTimeOffset AddMinutes(
double minutes
)
Parameters
DateTimeOffset.AddMinutes
has the following parameters.
minutes
- A number of whole and fractional minutes. The number can be negative or positive.
Returns
DateTimeOffset.AddMinutes
method returns An object whose value is the sum of the date and time represented by the current
DateTimeOffset object and the number of minutes represented by minutes.
Example
using System;/* ww w.j ava2 s . com*/
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset startTime = new DateTimeOffset(2014, 8, 6, 0, 0, 0,
DateTimeOffset.Now.Offset);
DateTimeOffset startOfShift = startTime.AddMinutes(8);
Console.WriteLine("Shifts for the week of {0:D}", startOfShift);
}
}
The code above generates the following result.