

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Program to get the absolute value of the time
To get the absolute value of time, use the TimesSpan Duration() method.
Let’s say the following is our TimeSpan.
TimeSpan ts = new TimeSpan(-7, -50, -25);
Now to get the absolute value.
TimeSpan duration = ts.Duration();
Let us see the complete code.
Example
using System; using System.Linq; public class Demo { public static void Main() { TimeSpan ts = new TimeSpan(-7, -50, -25); TimeSpan duration = ts.Duration(); Console.WriteLine(duration); } }
Output
07:50:25
- Related Questions & Answers
- How to get the absolute value of a number in JavaScript?
- Get the absolute value of float, int, double and long in Java
- Get Absolute value with MongoDB aggregation framework?
- C# Program to get the last write time of a file
- C# Program to get the last access time of a file
- Calculate the absolute value of float values in Numpy
- Calculate the absolute value of complex numbers in Numpy
- How to get the absolute coordinates of a view in Android?
- Java Program to get the File object with the absolute path for the directory or file
- Return the absolute value of a masked Array in NumPy
- Java Program to get the current value of the system timer in nanoseconds
- How to get the absolute path of a file using tkFileDialog(Tkinter)?
- Calculate the absolute value element-wise in Numpy
- Golang program to calculate the absolute and scale of a vertex.
- Get the absolute path for the directory or file in Java
Advertisements