Create a TimeSpan instance, specifying the days, hours, minutes, seconds, and milliseconds : TimeSpan « Date Time « C# / CSharp Tutorial

C# / CSharp Tutorial
1. Language Basics
2. Data Type
3. Operator
4. Statement
5. String
6. struct
7. Class
8. Operator Overload
9. delegate
10. Attribute
11. Data Structure
12. Assembly
13. Date Time
14. Development
15. File Directory Stream
16. Preprocessing Directives
17. Regular Expression
18. Generic
19. Reflection
20. Thread
21. I18N Internationalization
22. GUI Windows Forms
23. 2D
24. Design Patterns
25. Windows
26. XML
27. ADO.Net
28. Network
29. Directory Services
30. Security
31. unsafe
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorial
C# / C Sharp
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C# / CSharp Tutorial » Date Time » TimeSpan 
13. 5. 9. Create a TimeSpan instance, specifying the days, hours, minutes, seconds, and milliseconds
using System;

class MainClas
{
  public static void Main()
  {
    
    int hours = 4;
    int minutes = 12;
    int seconds = 10;
    int days = 1;
    int milliseconds = 20;
    TimeSpan myTimeSpan3 = new TimeSpan(days, hours, minutes, seconds, milliseconds);
    Console.WriteLine("myTimeSpan3 = " + myTimeSpan3);
  }
}
myTimeSpan3 = 1.04:12:10.0200000
13. 5. TimeSpan
13. 5. 1. Create a TimeSpan representing 2.5 days
13. 5. 2. TimeSpan calculation
13. 5. 3. Manual Profiler
13. 5. 4. Create a TimeSpan representing 1 week
13. 5. 5. Use the Add() method to add a TimeSpan to a DateTime
13. 5. 6. Use the Subtract() method to subtract a TimeSpan from a DateTime
13. 5. 7. Create a TimeSpan instance, specifying the hours, minutes, and seconds
13. 5. 8. Create a TimeSpan instance, specifying the days, hours, minutes,and seconds
13. 5. 9. Create a TimeSpan instance, specifying the days, hours, minutes, seconds, and milliseconds
13. 5. 10. Create a TimeSpan instance, specifying the number of ticks
13. 5. 11. Display the properties for myTimeSpan
13. 5. 12. Measures the time taken to add some numbers
13. 5. 13. Use the FromDays(), FromHours(), FromMinutes(), FromSeconds(), FromMilliseconds(), and FromTicks() methods to create new TimeSpan instances
13. 5. 14. Use the Add() method to add a TimeSpan instance to another
13. 5. 15. Use the Subtract() method to subtract a TimeSpan instance from another
13. 5. 16. Use the Duration() method to add two TimeSpan instances
13. 5. 17. Use the Negate() method to add two TimeSpan instances
w_w___w__.j___a___v__a_2_s___._c___o___m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.