Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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
How to get the start and end times of a day
WhatsApp
Arulraj Aboorvasamy
Mar 02
2015
10
k
0
1
var dates =
new
string
[2];
dates[0] = DateTime.Today.AddTicks(1).ToString(CultureInfo.InvariantCulture);
dates[1] = DateTime.Today.AddDays(1).AddTicks(-2).ToString(CultureInfo.InvariantCulture);
var startDate = DateTime.Parse(dates[0]).Date;
var endDate = DateTime.Parse(dates[1]).Date.AddDays(1).AddTicks(-1);
var oneDayTime = endDate - startDate;
Note: Getting the Date object is important here
Date time
filtering
one day time
start and end times of a day
Up Next
How to get the start and end times of a day