Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DateTime.AddMilliseconds Method

.NET Micro Framework 3.0
Adds a specified number of milliseconds to the current DateTime object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

public DateTime AddMilliseconds (
         double val


A specific number of milliseconds. Note that the number in the val parameter can be either positive or negative, and it can express partial milliseconds as well as whole milliseconds.

Return Value

A new DateTime object having a value that represents the sum of the current DateTime object and the specified number of milliseconds.

This method does not change the value of the current DateTime object; rather, it returns a new DateTime object.

The fractional part of a millisecond is represented by the fractional part of the val parameter (that is, anything to the right of the decimal point). For example, 4.5 is equivalent to 4 milliseconds and 5,000 ticks, where one millisecond equals 10,000 ticks. The number in the val parameter is rounded to the nearest tick.

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.