Add a specified number of milliseconds to the current DateTimeOffset in CSharp
Description
The following code shows how to add a specified number of milliseconds to the current DateTimeOffset.
Example
using System;/*from ww w .j a v a2 s . co m*/
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.AddMilliseconds(8);
Console.WriteLine("Shifts for the week of {0:D}", startOfShift);
}
}
The code above generates the following result.