How do I get yesterdays date?

V

VB Programmer

How can I get yesterdays date?

I would think now.date.subtract(1) works, but it doesn't.

Thank.
 
Joined
Sep 16, 2008
Messages
1
Reaction score
0
Yesterday's date

Here is how you can find yesterdays date:

Datetime.Now.Adddays(-1) will give you yesterdays date. You see, how life is simplified in C#. So the AddDays() method will add the value u have as its argument and re-calculate it self to find the exact date of yesterday if it is -1 or tomorrow if you have positive 1.
I think this might help u. If not please let me know.
Enjoy C#:flute:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,163
Messages
2,570,897
Members
47,434
Latest member
TobiasLoan

Latest Threads

Top