C# Corner
Tech
News
Videos
Forums
Trainings
Books
Live
More
Interviews
Events
Jobs
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Add DateTime and TimeSpan in C#.Net
WhatsApp
Vinay Singh
Aug 18
2016
24.7
k
0
0
using
System;
public
class
MainClass{
public
static
void
Main(String[] argv){
DateTime today = DateTime.Now;
TimeSpan duration =
new
TimeSpan(36, 0, 0, 0);
DateTime answer = today.Add(duration);
Console.WriteLine(
"{0:dddd}"
, answer);
}
}
OUTPUT
Thursday
Add DateTime
TimeSpan
C#
.Net
Up Next
Add DateTime and TimeSpan in C#.Net