@@ -258,7 +258,42 @@ public double TotalMilliseconds
258
258
/// <param name="value">A number of ticks that represent a time.</param>
259
259
/// <returns>An object that represents value.</returns>
260
260
public static TimeSpan FromTicks ( long value ) => new TimeSpan ( value ) ;
261
+
262
+ /// <summary>
263
+ /// Returns a <see cref="TimeSpan"/> that represents a specified time, where the specification is in units of miliseconds.
264
+ /// </summary>
265
+ /// <param name="value">A number of miliseconds that represent a time.</param>
266
+ /// <returns>An object that represents value.</returns>
267
+ public static TimeSpan FromMiliseconds ( long value ) => new TimeSpan ( TimeSpan . TicksPerMillisecond * value ) ;
268
+
269
+ /// <summary>
270
+ /// Returns a <see cref="TimeSpan"/> that represents a specified time, where the specification is in units of seconds.
271
+ /// </summary>
272
+ /// <param name="value">A number of seconds that represent a time.</param>
273
+ /// <returns>An object that represents value.</returns>
274
+ public static TimeSpan FromSeconds ( long value ) => new TimeSpan ( TimeSpan . TicksPerSecond * value ) ;
275
+
276
+ /// <summary>
277
+ /// Returns a <see cref="TimeSpan"/> that represents a specified time, where the specification is in units of minute.
278
+ /// </summary>
279
+ /// <param name="value">A number of minute that represent a time.</param>
280
+ /// <returns>An object that represents value.</returns>
281
+ public static TimeSpan FromMinutes ( long value ) => new TimeSpan ( TimeSpan . TicksPerMinute * value ) ;
261
282
283
+ /// <summary>
284
+ /// Returns a <see cref="TimeSpan"/> that represents a specified time, where the specification is in units of hours.
285
+ /// </summary>
286
+ /// <param name="value">A number of hours that represent a time.</param>
287
+ /// <returns>An object that represents value.</returns>
288
+ public static TimeSpan FromHours ( long value ) => new TimeSpan ( TimeSpan . TicksPerHour * value ) ;
289
+
290
+ /// <summary>
291
+ /// Returns a <see cref="TimeSpan"/> that represents a specified time, where the specification is in units of days.
292
+ /// </summary>
293
+ /// <param name="value">A number of days that represent a time.</param>
294
+ /// <returns>An object that represents value.</returns>
295
+ public static TimeSpan FromDays ( long value ) => new TimeSpan ( TimeSpan . TicksPerDay * value ) ;
296
+
262
297
/// <summary>
263
298
/// Converts the value of the current <see cref="TimeSpan"/> object to its equivalent string representation.
264
299
/// </summary>
0 commit comments