I have a program that send me a time for any account.
For some people, the program sends the datetime to the database like 2020-05-17 11:33:00
.
For some people, the program sends the datetime to the database like 0000-00-00 00:00:00
.
A photo to prove this:
The code which get the datetime is:
Imports System.Globalization
Imports System.Net
Public Shared Function GetNistTime() As DateTime
Dim myHttpWebRequest = CType(WebRequest.Create("http://www.microsoft.com"), HttpWebRequest)
Dim response = myHttpWebRequest.GetResponse()
Dim todaysDates As String = response.Headers("date")
Return DateTime.ParseExact(todaysDates, "ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture.DateTimeFormat, DateTimeStyles.AssumeUniversal)
End Function
So what is the solution? What can these people install on their machines to prevent this, like install .NET Framework 3.5?
I don't know if installing .NET Framework 3.5 can solve this problem!
I think it can solve the problem because I found it on my PC, and on another PC where I get the datetime like 0000-00-00 00:00:00
doesn't have it installed.