Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

40,026 questions

51,982 answers

573 users

How to get the date of yesterday in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(DateTime.Today.AddDays(-1));
        }
    }
}


/*
run:
      
04/08/2018 00:00:00
  
*/

 



answered Aug 5, 2018 by avibootz

Related questions

3 answers 141 views
141 views asked Aug 10, 2023 by avibootz
1 answer 129 views
129 views asked Aug 11, 2023 by avibootz
3 answers 154 views
154 views asked Aug 11, 2023 by avibootz
1 answer 111 views
111 views asked Apr 10, 2022 by avibootz
1 answer 166 views
1 answer 178 views
178 views asked Aug 26, 2020 by avibootz
1 answer 114 views
...