Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What was the date 180 days ago?

Tags:

How would I get the date 180 days ago using C#?

like image 535
Jamie Avatar asked Feb 23 '10 16:02

Jamie


People also ask

How many days was 180 days?

180 days equals roughly 6 months. A month contains 30 or 31 days, except for February. To convert a number of days to months, you can say 30 days is equivalent to one month. So if you divide 180 (the number of days you are converting) by 30 (the number of days in a month), you get 6.

When was 194 days from now?

So if you calculate everyday one-by-one from One Hundred Ninety-four days, you will find that it would be May 27, 2023 after 194 days since the date November 14, 2022.

What was the date 20 000 days ago?

So if you calculate everyday one-by-one Twenty Thousand days ago, you will find that it was February 10, 1968 before 20000 days since the date November 13, 2022.

What is the date 891 days from today?

This day calculation is based on all days, which is Monday through Sunday (including weekends). So if you calculate everyday one-by-one from Eight Hundred Ninety-one days, you will find that it would be April 10, 2025 after 891 days since the date November 01, 2022.


2 Answers

DateTime oneEightyAgo = DateTime.Today.AddDays(-180); 
like image 78
sidney.andrews Avatar answered Oct 14 '22 10:10

sidney.andrews


EDIT:

DateTime day180 = Date.Now.AddDays(-180); 

It's important to put it into a separate variable otherwise the value will be lost.

like image 31
Joel Etherton Avatar answered Oct 14 '22 08:10

Joel Etherton