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 yesterday date in VB.NET

3 Answers

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim yesterday As DateTime = DateTime.Today.AddDays(-1)
		
        Console.Write(yesterday)
    End Sub
End Class



' run:
'
' 8/10/2023 12:00:00 AM
'

 



answered Aug 11, 2023 by avibootz
0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim yesterday As DateTime = DateTime.Now.AddDays(-1)
		
        Console.Write(yesterday)
    End Sub
End Class



' run:
'
' 8/10/2023 7:01:20 AM
'

 



answered Aug 11, 2023 by avibootz
0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim yesterday As String = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd")
		
        Console.Write(yesterday)
    End Sub
End Class



' run:
'
' 2023-08-10
'

 



answered Aug 11, 2023 by avibootz

Related questions

1 answer 151 views
151 views asked Sep 18, 2018 by avibootz
1 answer 129 views
129 views asked Aug 11, 2023 by avibootz
3 answers 141 views
141 views asked Aug 10, 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
...